Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.82 KB | None | 0 0
  1. server {
  2. listen 443 ssl http2;
  3. server_name www.nuocmamphuha.com;
  4.  
  5. # SSL
  6. ssl_certificate /etc/letsencrypt/live/nuocmamphuha.com/fullchain.pem;
  7. ssl_certificate_key /etc/letsencrypt/live/nuocmamphuha.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://nuocmamphuha.com$1 permanent;
  12. }
  13. server {
  14. listen 80;
  15. server_name nuocmamphuha.com www.nuocmamphuha.com;
  16. rewrite ^(.*) https://nuocmamphuha.com$1 permanent;
  17. }
  18.  
  19. server {
  20. listen 443 ssl http2;
  21.  
  22. # access_log off;
  23. access_log /home/nuocmamphuha.com/logs/access.log;
  24. # error_log off;
  25. error_log /home/nuocmamphuha.com/logs/error.log;
  26.  
  27. root /home/nuocmamphuha.com/public_html;
  28. index index.php index.html index.htm;
  29. server_name nuocmamphuha.com;
  30.  
  31. # SSL
  32. ssl_certificate /etc/letsencrypt/live/nuocmamphuha.com/fullchain.pem;
  33. ssl_certificate_key /etc/letsencrypt/live/nuocmamphuha.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/nuocmamphuha.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 $document_root$fastcgi_script_name;
  68. }
  69. location /nginx_status {
  70. stub_status on;
  71. access_log off;
  72. allow 127.0.0.1;
  73. allow 172.104.102.187;
  74. deny all;
  75. }
  76.  
  77. location /php_status {
  78. fastcgi_pass 127.0.0.1:9000;
  79. fastcgi_index index.php;
  80. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  81. include /etc/nginx/fastcgi_params;
  82. allow 127.0.0.1;
  83. allow 172.104.102.187;
  84. deny all;
  85. }
  86.  
  87. # Disable .htaccess and other hidden files
  88. location ~ /\.(?!well-known).* {
  89. deny all;
  90. access_log off;
  91. log_not_found off;
  92. }
  93.  
  94. location = /favicon.ico {
  95. log_not_found off;
  96. access_log off;
  97. }
  98.  
  99. location = /robots.txt {
  100. allow all;
  101. log_not_found off;
  102. access_log off;
  103. }
  104.  
  105. 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|ttf|woff)$ {
  106. gzip_static off;
  107. add_header Pragma public;
  108. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  109. access_log off;
  110. expires 30d;
  111. break;
  112. }
  113.  
  114. location ~* \.(txt|js|css)$ {
  115. add_header Pragma public;
  116. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  117. access_log off;
  118. expires 30d;
  119. break;
  120. }
  121. }
  122.  
  123. server {
  124. listen 2017 ssl http2;
  125.  
  126. access_log off;
  127. log_not_found off;
  128. error_log /home/nuocmamphuha.com/logs/nginx_error.log;
  129. root /home/nuocmamphuha.com/private_html;
  130. index index.php index.html index.htm;
  131. server_name nuocmamphuha.com;
  132. error_page 497 https://$server_name:2017$request_uri;
  133. # SSL
  134. ssl_certificate /etc/letsencrypt/live/nuocmamphuha.com/fullchain.pem;
  135. ssl_certificate_key /etc/letsencrypt/live/nuocmamphuha.com/privkey.pem;
  136. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  137. ssl_prefer_server_ciphers on;
  138. ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  139.  
  140. auth_basic "Restricted";
  141. auth_basic_user_file /home/nuocmamphuha.com/private_html/hocvps/.htpasswd;
  142.  
  143. location / {
  144. autoindex on;
  145. try_files $uri $uri/ /index.php;
  146. }
  147.  
  148. location ~ \.php$ {
  149. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  150. include /etc/nginx/fastcgi_params;
  151. fastcgi_pass 127.0.0.1:9000;
  152. fastcgi_index index.php;
  153. fastcgi_connect_timeout 1000;
  154. fastcgi_send_timeout 1000;
  155. fastcgi_read_timeout 1000;
  156. fastcgi_buffer_size 256k;
  157. fastcgi_buffers 4 256k;
  158. fastcgi_busy_buffers_size 256k;
  159. fastcgi_temp_file_write_size 256k;
  160. fastcgi_intercept_errors on;
  161. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  162. }
  163.  
  164. location ~ /\. {
  165. deny all;
  166. }
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement