nginx-prod-https.conf 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 443 ssl;
  24. set $folder_name /var/www/html;
  25. server_name www.xyzshops.cn;
  26. root $folder_name;
  27. ssl_certificate cert/www.xyzshops.cn.pem;
  28. ssl_certificate_key cert/www.xyzshops.cn.key;
  29. ssl_session_cache shared:SSL:1m;
  30. ssl_session_timeout 5m;
  31. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #使用此加密套件。
  32. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #使用该协议进行配置。
  33. ssl_prefer_server_ciphers on;
  34. index index.html index.php;
  35. client_max_body_size 100m;
  36. proxy_connect_timeout 500s;
  37. proxy_read_timeout 500s;
  38. proxy_send_timeout 500s;
  39. fastcgi_connect_timeout 75;
  40. fastcgi_read_timeout 600;
  41. fastcgi_send_timeout 600;
  42. charset utf-8;
  43. location /logs {
  44. deny all;
  45. return 403;
  46. }
  47. location /data/log {
  48. deny all;
  49. return 403;
  50. }
  51. location / {
  52. index index.html index.htm index.php;
  53. }
  54. location /mshop {
  55. root $folder_name;
  56. autoindex on;
  57. index index.html index.htm index.php;
  58. try_files $uri $uri/ /mshop/index.html;
  59. }
  60. location /merchant {
  61. root $folder_name;
  62. autoindex on;
  63. index index.html index.htm index.php;
  64. try_files $uri $uri/ /merchant/index.html;
  65. }
  66. location ~ /mobile/[/\w]+\.php$ {
  67. root $folder_name;
  68. fastcgi_pass mobilesrv:9100;
  69. fastcgi_index index.php;
  70. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  71. include fastcgi_params;
  72. }
  73. location ~ /mobile/[/\w]+\.html$ {
  74. try_files $uri $uri/ /mobile/index.html;
  75. }
  76. location ~ \.php$ {
  77. add_header Cache-Control no-store;
  78. root $folder_name;
  79. fastcgi_pass websrv:9000;
  80. fastcgi_index index.php;
  81. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  82. include fastcgi_params;
  83. }
  84. }
  85. }