nginx.conf 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. user nginx;
  2. worker_processes 8;
  3. error_log /var/error.log info;
  4. worker_rlimit_nofile 10240;
  5. events {
  6. worker_connections 8192;
  7. multi_accept on;
  8. use epoll;
  9. }
  10. http
  11. {
  12. include mime.types;
  13. default_type application/octet-stream;
  14. fastcgi_buffer_size 32k;
  15. fastcgi_buffers 8 32k;
  16. underscores_in_headers on;
  17. client_max_body_size 1024M;
  18. tcp_nopush on;
  19. sendfile on;
  20. keepalive_timeout 65;
  21. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  22. '$status $body_bytes_sent "$http_referer" '
  23. '"$http_user_agent" "$http_x_forwarded_for"';
  24. server
  25. {
  26. listen 80;
  27. set $folder_name /var/www/html;
  28. server_name www.xyzshops.cn order.xyzshops.cn;
  29. root $folder_name;
  30. index index.html index.php;
  31. client_max_body_size 100m;
  32. proxy_connect_timeout 500s;
  33. proxy_read_timeout 500s;
  34. proxy_send_timeout 500s;
  35. fastcgi_connect_timeout 75;
  36. fastcgi_read_timeout 600;
  37. fastcgi_send_timeout 600;
  38. set_real_ip_from 100.64.0.0/10;
  39. real_ip_header X-Forwarded-For;
  40. charset utf-8;
  41. location /logs {
  42. deny all;
  43. return 403;
  44. }
  45. location /data/log {
  46. deny all;
  47. return 403;
  48. }
  49. location / {
  50. index index.html index.htm index.php;
  51. }
  52. location /mshop {
  53. root $folder_name;
  54. autoindex on;
  55. index index.html index.htm index.php;
  56. try_files $uri $uri/ /mshop/index.html;
  57. }
  58. location /plot {
  59. root $folder_name;
  60. proxy_pass http://docker.hostip:5000;
  61. proxy_redirect off;
  62. proxy_set_header Host $host;
  63. proxy_set_header X-Real-IP $remote_addr;
  64. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  65. proxy_set_header X-Forwarded-Proto $scheme;
  66. }
  67. location /merchant {
  68. root $folder_name;
  69. autoindex on;
  70. index index.html index.htm index.php;
  71. try_files $uri $uri/ /merchant/index.html;
  72. }
  73. location ~ /mobile/[/\w]+\.php$ {
  74. root $folder_name;
  75. fastcgi_pass docker.hostip:9100;
  76. fastcgi_index index.php;
  77. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  78. fastcgi_param SIGN $http_sign;
  79. include fastcgi_params;
  80. }
  81. location ~ /mobile/[/\w]+\.html$ {
  82. try_files $uri $uri/ /mobile/index.html;
  83. }
  84. location ~ /racc/[/\w]+\.php$ {
  85. root $folder_name;
  86. fastcgi_pass docker.hostip:9101;
  87. fastcgi_index index.php;
  88. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  89. fastcgi_param SIGN $http_sign;
  90. include fastcgi_params;
  91. }
  92. location ~ /mchsrv/[/\w]+\.php$ {
  93. root $folder_name;
  94. fastcgi_pass 172.26.105.125:9102;
  95. fastcgi_index index.php;
  96. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  97. fastcgi_param SIGN $http_sign;
  98. include fastcgi_params;
  99. }
  100. location ~ \.php$ {
  101. add_header Cache-Control no-store;
  102. root $folder_name;
  103. fastcgi_pass 172.26.105.125:9000;
  104. fastcgi_index index.php;
  105. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  106. include fastcgi_params;
  107. }
  108. }
  109. }