nginx-prod-https.conf 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 ~ /mobile/[/\w]+\.php$ {
  61. root $folder_name;
  62. fastcgi_pass mobilesrv:9100;
  63. fastcgi_index Index.php;
  64. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  65. include fastcgi_params;
  66. }
  67. location ~ /mobile/[/\w]+\.html$ {
  68. try_files $uri $uri/ /mobile/index.html;
  69. }
  70. location ~ \.php$ {
  71. add_header Cache-Control no-store;
  72. root $folder_name;
  73. fastcgi_pass fpmsrv:9000;
  74. fastcgi_index Index.php;
  75. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  76. include fastcgi_params;
  77. }
  78. }
  79. }