Advertisement
Guest User

site.conf

a guest
Feb 17th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. server_name chatclub.bg www.chatclub.bg;
  5. root /var/www/chatclub.bg/public_html;
  6. index index.php;
  7. rewrite ^ https://$server_name$request_uri? permanent;
  8. }
  9.  
  10. server {
  11. listen 443 ssl http2;
  12. listen [::]:443 ssl http2;
  13. root /var/www/chatclub.bg/public_html;
  14. index index.php index.html index.htm index.nginx-debian.html;
  15. server_name chatclub.bg www.chatclub.bg;
  16.  
  17. error_page 403 https://chatclub.bg/403.html;
  18. location = /403.html {
  19. allow all;
  20. }
  21.  
  22. location ~* \.(jpg|jpeg|png|gif|ico|css|js|manifest|appcache|html|xml|json|rss|atom|cur|mp3|gz|svg|svgz|ogg|ovg|webm|htc)$ {
  23. expires 365d;
  24. }
  25.  
  26. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
  27.  
  28. location ~* /(?:[.]|.*[.](?:bak|fla|inc|ini|log|psd|sh|sql|swp)|(?:file|upload)s?/.*[.](?:php)){
  29. return 403;
  30. }
  31.  
  32. if ($host = 'www.chatclub.bg' ) {
  33. rewrite ^/(.*)$ https://chatclub.bg/$1 permanent;
  34. }
  35.  
  36. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  37. ssl_certificate /etc/ssl/chatclub_bg.crt;
  38. ssl_certificate_key /etc/ssl/chatclub_bg.key;
  39. ssl_dhparam /etc/ssl/certs/dhparam.pem;
  40. ssl_stapling on;
  41. ssl_stapling_verify on;
  42. ssl_trusted_certificate /etc/nginx/ssl/ocsp.pem;
  43.  
  44. location / {
  45. try_files $uri $uri/ =404;
  46. }
  47.  
  48. location ~ \.php$ {
  49. try_files $uri =404;
  50. fastcgi_pass 127.0.0.1:9000;
  51. fastcgi_index index.php;
  52. fastcgi_read_timeout 240;
  53. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  54. include fastcgi_params;
  55. }
  56.  
  57. location ~ /\. {
  58. deny all;
  59. }
  60.  
  61. location ~ /\.ht {
  62. access_log off;
  63. log_not_found off;
  64. deny all;
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement