Advertisement
Guest User

Untitled

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