nginx.conf 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. user nginx;
  2. worker_processes 16;
  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. underscores_in_headers on;
  15. client_max_body_size 32M;
  16. client_body_buffer_size 1024K;
  17. tcp_nopush on;
  18. sendfile on;
  19. keepalive_timeout 300;
  20. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  21. '$status $body_bytes_sent "$http_referer" '
  22. '"$http_user_agent" "$http_x_forwarded_for"';
  23. server
  24. {
  25. listen 80;
  26. set $folder_name /var/www/html;
  27. server_name youjun.xyzshops.cn;
  28. root $folder_name;
  29. index index.html index.php;
  30. proxy_connect_timeout 500s;
  31. proxy_read_timeout 500s;
  32. proxy_send_timeout 500s;
  33. fastcgi_connect_timeout 75;
  34. fastcgi_read_timeout 600;
  35. fastcgi_send_timeout 600;
  36. fastcgi_buffer_size 32K;
  37. fastcgi_buffers 32 32K;
  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 ~ /mobile/[/\w]+\.php$ {
  59. root $folder_name;
  60. fastcgi_pass docker.hostip:9100;
  61. fastcgi_index index.php;
  62. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  63. fastcgi_param SIGN $http_sign;
  64. include fastcgi_params;
  65. }
  66. location ~ /mobile/[/\w]+\.html$ {
  67. try_files $uri $uri/ /mobile/index.html;
  68. }
  69. location ~ /mchsrv/[/\w]+\.php$ {
  70. root $folder_name;
  71. fastcgi_pass 172.26.80.6:9102;
  72. fastcgi_index index.php;
  73. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  74. fastcgi_param SIGN $http_sign;
  75. include fastcgi_params;
  76. }
  77. location ~ \.php$ {
  78. add_header Cache-Control no-store;
  79. root $folder_name;
  80. fastcgi_pass docker.hostip:9000;
  81. fastcgi_index index.php;
  82. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  83. fastcgi_buffer_size 1024K;
  84. fastcgi_buffers 32 1024K;
  85. proxy_buffer_size 128k; #设置缓冲区的大小和数量
  86. proxy_buffers 100 128k; #
  87. proxy_read_timeout 900s;
  88. proxy_send_timeout 900s;
  89. fastcgi_read_timeout 900;
  90. fastcgi_send_timeout 900;
  91. keepalive_timeout 900;
  92. include fastcgi_params;
  93. }
  94. }
  95. }