nginx.conf 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. user nginx;
  2. worker_processes 1;
  3. error_log /var/error.log info;
  4. worker_rlimit_nofile 1024;
  5. events {
  6. worker_connections 1024;
  7. }
  8. http
  9. {
  10. include mime.types;
  11. default_type application/octet-stream;
  12. fastcgi_buffer_size 32k;
  13. fastcgi_buffers 8 32k;
  14. underscores_in_headers on;
  15. client_max_body_size 1024M;
  16. sendfile on;
  17. keepalive_timeout 65;
  18. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  19. '$status $body_bytes_sent "$http_referer" '
  20. '"$http_user_agent" "$http_x_forwarded_for"';
  21. server
  22. {
  23. listen 80;
  24. set $folder_name /var/www/html;
  25. server_name 192.168.31.168 www.xyxy.com;
  26. root $folder_name;
  27. index index.html index.php;
  28. client_max_body_size 100m;
  29. proxy_connect_timeout 500s;
  30. proxy_read_timeout 500s;
  31. proxy_send_timeout 500s;
  32. fastcgi_connect_timeout 75;
  33. fastcgi_read_timeout 600;
  34. fastcgi_send_timeout 600;
  35. charset utf-8;
  36. location /logs {
  37. deny all;
  38. return 403;
  39. }
  40. location /data/log {
  41. deny all;
  42. return 403;
  43. }
  44. location / {
  45. index index.html index.htm index.php;
  46. }
  47. location /mshop {
  48. root $folder_name;
  49. autoindex on;
  50. index index.html index.htm index.php;
  51. try_files $uri $uri/ /mshop/index.html;
  52. }
  53. location ~ /mchsrv/[/\w]+\.php$ {
  54. root $folder_name;
  55. fastcgi_pass mchsrv:9102;
  56. fastcgi_index index.php;
  57. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  58. fastcgi_param SIGN $http_sign;
  59. include fastcgi_params;
  60. }
  61. location ~ /vapi/[/\w]+\.php$ {
  62. root $folder_name;
  63. fastcgi_pass vapisrv:9103;
  64. fastcgi_index index.php;
  65. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  66. fastcgi_param SIGN $http_sign;
  67. include fastcgi_params;
  68. }
  69. location ~ \.php$ {
  70. add_header Cache-Control no-store;
  71. root $folder_name;
  72. fastcgi_pass websrv:9000;
  73. fastcgi_index index.php;
  74. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  75. include fastcgi_params;
  76. }
  77. }
  78. server {
  79. listen 80;
  80. server_name xyxyxy.com;
  81. return 301 http://www.xyxy.com;
  82. }
  83. }