Advertisement
Guest User

Untitled

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