Advertisement
Guest User

Untitled

a guest
Dec 30th, 2017
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1. server {
  2. listen 443 ssl http2;
  3. server_name http://www.quannguyenphat.com;
  4.  
  5. # SSL
  6. ssl_certificate /etc/letsencrypt/live/quannguyenphat.com/fullchain.pem;
  7. ssl_certificate_key /etc/letsencrypt/live/quannguyenphat.com/privkey.pem;
  8. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  9. ssl_prefer_server_ciphers on;
  10. ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  11. rewrite ^(.*) https://quannguyenphat.com$1 permanent;
  12. }
  13. server {
  14. listen 80;
  15.  
  16. server_name quannguyenphat.com http://www.quannguyenphat.com;
  17. rewrite ^(.*) https://quannguyenphat.com$1 permanent;
  18. }
  19. server {
  20. listen 443 ssl http2;
  21.  
  22. # access_log off;
  23. access_log /home/quannguyenphat.com/logs/access.log;
  24. # error_log off;
  25. error_log /home/quannguyenphat.com/logs/error.log;
  26.  
  27. root /home/quannguyenphat.com/public_html;
  28. index index.php index.html index.htm;
  29. server_name http://www.quannguyenphat.com;
  30.  
  31. # SSL
  32. ssl_certificate /etc/letsencrypt/live/quannguyenphat.com/fullchain.pem;
  33. ssl_certificate_key /etc/letsencrypt/live/quannguyenphat.com/privkey.pem;
  34. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  35. ssl_prefer_server_ciphers on;
  36. ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  37.  
  38. # Improve HTTPS performance with session resumption
  39. ssl_session_cache shared:SSL:50m;
  40. ssl_session_timeout 1d;
  41. # DH parameters
  42. ssl_dhparam /etc/nginx/ssl/dhparam.pem;
  43. # Enable HSTS
  44. add_header Strict-Transport-Security “max-age=31536000” always;
  45. location / {
  46. try_files $uri $uri/ /index.php?$args;
  47. }
  48.  
  49. # Custom configuration
  50. include /home/quannguyenphat.com/public_html/*.conf;
  51.  
  52. location ~ \.php$ {
  53. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  54. include /etc/nginx/fastcgi_params;
  55. fastcgi_pass 127.0.0.1:9000;
  56. fastcgi_index index.php;
  57. fastcgi_connect_timeout 1000;
  58. fastcgi_send_timeout 1000;
  59. fastcgi_read_timeout 1000;
  60. fastcgi_buffer_size 256k;
  61. fastcgi_buffers 4 256k;
  62. fastcgi_busy_buffers_size 256k;
  63. fastcgi_temp_file_write_size 256k;
  64. fastcgi_intercept_errors on;
  65. fastcgi_param SCRIPT_FILENAME /home/quannguyenphat.com/public_html$fastcgi_script_name;
  66. }
  67. location /nginx_status {
  68. stub_status on;
  69. access_log off;
  70. allow 127.0.0.1;
  71. deny all;
  72. }
  73. location /php_status {
  74. fastcgi_pass 127.0.0.1:9000;
  75. fastcgi_index index.php;
  76. fastcgi_param SCRIPT_FILENAME /home/quannguyenphat.com/public_html$fastcgi_script_name;
  77. include /etc/nginx/fastcgi_params;
  78. allow 127.0.0.1;
  79. deny all;
  80. }
  81. location ~ /\. {
  82. deny all;
  83. }
  84. location = /favicon.ico {
  85. log_not_found off;
  86. access_log off;
  87. }
  88. location = /robots.txt {
  89. allow all;
  90. log_not_found off;
  91. access_log off;
  92. }
  93. location ~* \.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|eot|sv$
  94. gzip_static off;
  95. add_header Pragma public;
  96. add_header Cache-Control “public, must-revalidate, proxy-revalidate”;
  97. access_log off;
  98. expires 30d;
  99. break;
  100. }
  101.  
  102. location ~* \.(txt|js|css)$ {
  103. add_header Pragma public;
  104. add_header Cache-Control “public, must-revalidate, proxy-revalidate”;
  105. access_log off;
  106. expires 30d;
  107. break;
  108. }
  109. }
  110. server {
  111. listen 1910 ssl http2;
  112.  
  113. access_log off;
  114. log_not_found off;
  115. error_log /home/quannguyenphat.com/logs/nginx_error.log;
  116.  
  117. root /home/quannguyenphat.com/private_html;
  118. index index.php index.html index.htm;
  119. server_name quannguyenphat.com;
  120.  
  121. error_page 497 https://$server_name:1910$request_uri;
  122. # SSL
  123. ssl_certificate /etc/letsencrypt/live/quannguyenphat.com/fullchain.pem;
  124. ssl_certificate_key /etc/letsencrypt/live/quannguyenphat.com/privkey.pem;
  125. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  126. ssl_prefer_server_ciphers on;
  127. ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  128.  
  129. auth_basic “Restricted”;
  130. auth_basic_user_file /home/quannguyenphat.com/private_html/hocvps/.htpasswd;
  131. location / {
  132. try_files $uri $uri/ /index.php;
  133. }
  134. location ~ \.php$ {
  135. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  136. include /etc/nginx/fastcgi_params;
  137. fastcgi_pass 127.0.0.1:9000;
  138. fastcgi_index index.php;
  139. fastcgi_connect_timeout 1000;
  140. fastcgi_send_timeout 1000;
  141. fastcgi_read_timeout 1000;
  142. fastcgi_buffer_size 256k;
  143. fastcgi_buffers 4 256k;
  144. fastcgi_busy_buffers_size 256k;
  145. fastcgi_temp_file_write_size 256k;
  146. fastcgi_buffers 4 256k;
  147. fastcgi_busy_buffers_size 256k;
  148. fastcgi_temp_file_write_size 256k;
  149. fastcgi_intercept_errors on;
  150. fastcgi_param SCRIPT_FILENAME /home/quannguyenphat.com/private_html$fastcgi_script_name;
  151. }
  152.  
  153. location ~ /\. {
  154. deny all;
  155. }
  156. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement