nginx-xyz-https.conf 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. sendfile on;
  19. keepalive_timeout 65;
  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 443 ssl;
  26. set $folder_name /var/www/html;
  27. server_name www.xyzshops.cn;
  28. root $folder_name;
  29. ssl_certificate cert/www.xyzshops.cn.pem;
  30. ssl_certificate_key cert/www.xyzshops.cn.key;
  31. ssl_session_cache shared:SSL:1m;
  32. ssl_session_timeout 5m;
  33. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #使用此加密套件。
  34. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #使用该协议进行配置。
  35. ssl_prefer_server_ciphers on;
  36. index index.html index.php;
  37. client_max_body_size 100m;
  38. proxy_connect_timeout 500s;
  39. proxy_read_timeout 500s;
  40. proxy_send_timeout 500s;
  41. fastcgi_connect_timeout 75;
  42. fastcgi_read_timeout 600;
  43. fastcgi_send_timeout 600;
  44. charset utf-8;
  45. location /logs {
  46. deny all;
  47. return 403;
  48. }
  49. location /data/log {
  50. deny all;
  51. return 403;
  52. }
  53. location / {
  54. index index.html index.htm index.php;
  55. }
  56. location /mshop {
  57. root $folder_name;
  58. autoindex on;
  59. index index.html index.htm index.php;
  60. try_files $uri $uri/ /mshop/index.html;
  61. }
  62. location /plot {
  63. root $folder_name;
  64. proxy_pass http://172.26.105.127:5000;
  65. proxy_redirect off;
  66. proxy_set_header Host $host;
  67. proxy_set_header X-Real-IP $remote_addr;
  68. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  69. proxy_set_header X-Forwarded-Proto $scheme;
  70. }
  71. location /merchant {
  72. root $folder_name;
  73. autoindex on;
  74. index index.html index.htm index.php;
  75. try_files $uri $uri/ /merchant/index.html;
  76. }
  77. location ~ /mobile/[/\w]+\.php$ {
  78. root $folder_name;
  79. fastcgi_pass docker.hostip:9100;
  80. fastcgi_index index.php;
  81. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  82. fastcgi_param SIGN $http_sign;
  83. include fastcgi_params;
  84. }
  85. location ~ /mobile/[/\w]+\.html$ {
  86. try_files $uri $uri/ /mobile/index.html;
  87. }
  88. location ~ /racc/[/\w]+\.php$ {
  89. root $folder_name;
  90. fastcgi_pass docker.hostip:9101;
  91. fastcgi_index index.php;
  92. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  93. fastcgi_param SIGN $http_sign;
  94. include fastcgi_params;
  95. }
  96. location ~ \.php$ {
  97. add_header Cache-Control no-store;
  98. root $folder_name;
  99. fastcgi_pass docker.hostip:9000;
  100. fastcgi_index index.php;
  101. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  102. include fastcgi_params;
  103. }
  104. }
  105. }