Advertisement
ngokchjnh109

Untitled

Aug 21st, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.81 KB | None | 0 0
  1. server {
  2. listen 443 ssl http2;
  3. server_name www.mayaptrungauco.com;
  4.  
  5. # SSL
  6. ssl_certificate /etc/letsencrypt/live/mayaptrungauco.com/fullchain.pem;
  7. ssl_certificate_key /etc/letsencrypt/live/mayaptrungauco.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://mayaptrungauco.com$1 permanent;
  12. }
  13.  
  14. server {
  15. listen 80;
  16.  
  17. server_name mayaptrungauco.com www.mayaptrungauco.com;
  18. rewrite ^(.*) https://mayaptrungauco.com$1 permanent;
  19. }
  20. server {
  21. listen 443 ssl http2;
  22.  
  23. # access_log off;
  24. access_log /home/mayaptrungauco.com/logs/access.log;
  25. # error_log off;
  26. error_log /home/mayaptrungauco.com/logs/error.log;
  27.  
  28. root /home/mayaptrungauco.com/public_html;
  29. index index.php index.html index.htm;
  30. server_name mayaptrungauco.com;
  31. # SSL
  32. ssl_certificate /etc/letsencrypt/live/mayaptrungauco.com/fullchain.pem;
  33. ssl_certificate_key /etc/letsencrypt/live/mayaptrungauco.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.  
  42. # DH parameters
  43. ssl_dhparam /etc/nginx/ssl/dhparam.pem;
  44. # Enable HSTS
  45. add_header Strict-Transport-Security "max-age=31536000" always;
  46.  
  47. location / {
  48. try_files $uri $uri/ /index.php?$args;
  49. }
  50.  
  51. # Custom configuration
  52. include /home/mayaptrungauco.com/public_html/*.conf;
  53.  
  54. location ~ \.php$ {
  55. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  56. include /etc/nginx/fastcgi_params;
  57. fastcgi_pass 127.0.0.1:9000;
  58. fastcgi_index index.php;
  59. fastcgi_connect_timeout 1000;
  60. fastcgi_send_timeout 1000;
  61. fastcgi_read_timeout 1000;
  62. fastcgi_buffer_size 256k;
  63. fastcgi_buffers 4 256k;
  64. fastcgi_busy_buffers_size 256k;
  65. fastcgi_temp_file_write_size 256k;
  66. fastcgi_intercept_errors on;
  67. fastcgi_param SCRIPT_FILENAME /home/mayaptrungauco.com/public_html$fastcgi_script_name;
  68. }
  69. location /nginx_status {
  70. stub_status on;
  71. access_log off;
  72. allow 127.0.0.1;
  73. deny all;
  74. }
  75. location /php_status {
  76. fastcgi_pass 127.0.0.1:9000;
  77. fastcgi_index index.php;
  78. fastcgi_param SCRIPT_FILENAME /home/mayaptrungauco.com/public_html$fastcgi_script_name;
  79. include /etc/nginx/fastcgi_params;
  80. allow 127.0.0.1;
  81. deny all;
  82. }
  83. location ~ /\. {
  84. deny all;
  85. }
  86. location = /favicon.ico {
  87. log_not_found off;
  88. access_log off;
  89. }
  90. location = /robots.txt {
  91. allow all;
  92. log_not_found off;
  93. access_log off;
  94. }
  95. 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|svg
  96. |ttf|woff)$ {
  97. gzip_static off;
  98. add_header Pragma public;
  99. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  100. access_log off;
  101. expires 30d;
  102. break;
  103. }
  104.  
  105. location ~* \.(txt|js|css)$ {
  106. add_header Pragma public;
  107. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  108. access_log off;
  109. expires 30d;
  110. break;
  111. }
  112. }
  113.  
  114. server {
  115. listen 3991 ssl http2;
  116.  
  117. access_log off;
  118. log_not_found off;
  119. error_log /home/mayaptrungauco.com/logs/nginx_error.log;
  120.  
  121. root /home/mayaptrungauco.com/private_html;
  122. index index.php index.html index.htm;
  123. server_name mayaptrungauco.com;
  124. error_page 497 https://$host:3991$request_uri;
  125. # SSL
  126. ssl_certificate /etc/letsencrypt/live/mayaptrungauco.com/fullchain.pem;
  127. ssl_certificate_key /etc/letsencrypt/live/mayaptrungauco.com/privkey.pem;
  128. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  129. ssl_prefer_server_ciphers on;
  130. ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  131.  
  132. auth_basic "Restricted";
  133. auth_basic_user_file /home/mayaptrungauco.com/private_html/hocvps/.htpasswd;
  134.  
  135. location / {
  136. try_files $uri $uri/ /index.php;
  137. }
  138.  
  139. location ~ \.php$ {
  140. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  141. include /etc/nginx/fastcgi_params;
  142. fastcgi_pass 127.0.0.1:9000;
  143. fastcgi_index index.php;
  144. fastcgi_connect_timeout 1000;
  145. fastcgi_send_timeout 1000;
  146. fastcgi_read_timeout 1000;
  147. fastcgi_buffer_size 256k;
  148. fastcgi_buffers 4 256k;
  149. fastcgi_busy_buffers_size 256k;
  150. fastcgi_temp_file_write_size 256k;
  151. fastcgi_intercept_errors on;
  152. fastcgi_param SCRIPT_FILENAME /home/mayaptrungauco.com/private_html$fastcgi_script_name;
  153. }
  154.  
  155. location ~ /\. {
  156. deny all;
  157. }
  158. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement