PHP微服务初始化框架
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.0 KiB

3 years ago
  1. # saltfish_raw_php.private.conf
  2. # saltfish_raw_php nginx private config.
  3. # This is a [private] api. It means nginx listen on port 8000.
  4. # @version 171017:1
  5. # @author karminski <code.karminski@outlook.com>
  6. # server config
  7. server {
  8. listen 8000;
  9. server_name saltfish-raw-php.juejin.im;
  10. # origin sessings
  11. include /data/apps/nginx/conf/origin/gold.xitu.io_and_juejin.im.conf;
  12. root /data/repo/saltfish_raw_php/src/;
  13. access_log /data/repo/saltfish_raw_php/logs/saltfish_raw_php.private.access.log logstash;
  14. error_log /data/repo/saltfish_raw_php/logs/saltfish_raw_php.private.error.log;
  15. client_body_temp_path /data/tmp/nginx/client_body_temp/ 1 2;
  16. proxy_temp_path /data/tmp/nginx/proxy_temp/ 1 2;
  17. fastcgi_temp_path /data/tmp/nginx/fastcgi_temp/ 1 2;
  18. rewrite "^(.*)/v1/sample$" $1/SampleApi.php?$query_string last;
  19. rewrite "^(.*)/status$" $1/status.php last;
  20. rewrite "^(.*)/server_env$" $1/server_env.php last;
  21. if ($request_uri ~ " ") {
  22. return 444;
  23. }
  24. location / {
  25. }
  26. location = /ENV {
  27. allow 127.0.0.1;
  28. deny all;
  29. }
  30. location ~* ^/DOCUMENTS{
  31. return 404;
  32. }
  33. location ~* ^/protected{
  34. return 404;
  35. }
  36. location ~* ^/test{
  37. return 404;
  38. }
  39. location ~* ^/logs{
  40. return 404;
  41. }
  42. location ~* ^/conf{
  43. return 404;
  44. }
  45. location = /favicon.ico {
  46. allow all;
  47. log_not_found off;
  48. access_log off;
  49. }
  50. location ~* ^/not_found{
  51. return 404;
  52. }
  53. location ~ /\. {
  54. deny all;
  55. access_log off;
  56. log_not_found off;
  57. }
  58. location ~ \.php$ {
  59. if ( $fastcgi_script_name ~ \..*\/.*php ) {
  60. return 403;
  61. }
  62. include fastcgi.conf;
  63. fastcgi_pass 127.0.0.1:9000;
  64. fastcgi_index index.php;
  65. }
  66. }