Advertisement
Guest User

Untitled

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