Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. # Centmin Mod Getting Started Guide
  2. # must read http://centminmod.com/getstarted.html
  3. # For SPDY SSL Setup
  4. # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
  5.  
  6. # redirect from www to non-www forced SSL
  7. # uncomment, save file and restart Nginx to enable
  8. # if unsure use return 302 before using return 301
  9. server {
  10. server_name data.cungcaphangsi.com www.data.cungcaphangsi.com;
  11. return 302 https://$server_name$request_uri;
  12. }
  13.  
  14. server {
  15. listen 443 ssl http2;
  16. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
  17.  
  18. server_name data.cungcaphangsi.com www.data.cungcaphangsi.com;
  19.  
  20. ## redirect https www to https non-www
  21. if ($host = 'www.data.cungcaphangsi.com' ) {
  22. return 302 https://data.cungcaphangsi.com$request_uri;
  23. }
  24.  
  25. ssl_dhparam /usr/local/nginx/conf/ssl/data.cungcaphangsi.com/dhparam.pem;
  26. ssl_certificate /usr/local/nginx/conf/ssl/data.cungcaphangsi.com/data.cungcaphangsi.com.crt;
  27. #ssl_certificate /usr/local/nginx/conf/ssl/data.cungcaphangsi.com/nginx_bundle_5caa09071cdd.crt;
  28. ssl_certificate_key /usr/local/nginx/conf/ssl/data.cungcaphangsi.com/data.cungcaphangsi.com.key;
  29.  
  30. include /usr/local/nginx/conf/ssl_include.conf;
  31.  
  32. # mozilla recommended
  33. ssl_ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!CAMELLIA:!DES-CBC3-SHA;
  34. ssl_prefer_server_ciphers on;
  35. #add_header Alternate-Protocol 443:npn-spdy/3;
  36. #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
  37. #add_header X-Content-Type-Options "nosniff";
  38. #add_header X-Frame-Options DENY;
  39. #spdy_headers_comp 5;
  40. ssl_buffer_size 1400;
  41. ssl_session_tickets on;
  42.  
  43. # enable ocsp stapling
  44. resolver 8.8.8.8 8.8.4.4 valid=10m;
  45. resolver_timeout 10s;
  46. ssl_stapling on;
  47. ssl_stapling_verify on;
  48. #ssl_trusted_certificate /usr/local/nginx/conf/ssl/data.cungcaphangsi.com/nginx_bundle_5caa09071cdd.crt;
  49.  
  50.  
  51. # ngx_pagespeed & ngx_pagespeed handler
  52. #include /usr/local/nginx/conf/pagespeed.conf;
  53. #include /usr/local/nginx/conf/pagespeedhandler.conf;
  54. #include /usr/local/nginx/conf/pagespeedstatslog.conf;
  55.  
  56. # limit_conn limit_per_ip 16;
  57. ssi on;
  58.  
  59. access_log /home/nginx/domains/data.cungcaphangsi.com/log/access.log combined buffer=256k flush=60m;
  60. error_log /home/nginx/domains/data.cungcaphangsi.com/log/error.log;
  61.  
  62. root /home/nginx/domains/data.cungcaphangsi.com/public;
  63.  
  64. # prevent access to ./directories and files
  65. location ~ (?:^|/)\. {
  66. deny all;
  67. }
  68.  
  69.  
  70.  
  71. location / {
  72. try_files $uri $uri/ /index.php?$uri&$args;
  73. index index.php index.html;
  74. }
  75.  
  76. location /install/data/ {
  77. internal;
  78. }
  79. location /install/templates/ {
  80. internal;
  81. }
  82. location /internal_data/ {
  83. internal;
  84. }
  85. location /library/ {
  86. internal;
  87. }
  88.  
  89. location ~ \.php$ {
  90. try_files $uri =404;
  91. fastcgi_pass 127.0.0.1:9000;
  92. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  93. include fastcgi_params;
  94. }
  95.  
  96.  
  97.  
  98. include /usr/local/nginx/conf/staticfiles.conf;
  99. include /usr/local/nginx/conf/php.conf;
  100. include /usr/local/nginx/conf/drop.conf;
  101. #include /usr/local/nginx/conf/errorpage.conf;
  102. include /usr/local/nginx/conf/vts_server.conf;
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement