demu.red 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. ## Main site config
  2. server {
  3. listen 80 default_server;
  4. listen [::]:80 default_server;
  5. listen 443 default_server ssl;
  6. listen [::]:443 default_server ssl;
  7. # SSL configuration
  8. #
  9. # listen 443 ssl default_server;
  10. # listen [::]:443 ssl default_server;
  11. #
  12. # Note: You should disable gzip for SSL traffic.
  13. # See: https://bugs.debian.org/773332
  14. #
  15. # Read up on ssl_ciphers to ensure a secure configuration.
  16. # See: https://bugs.debian.org/765782
  17. #
  18. # Self signed certs generated by the ssl-cert package
  19. # Don't use them in a production server!
  20. #
  21. # include snippets/snakeoil.conf;
  22. server_name demur.red; ## Name of server
  23. root /var/www/pelican; ## Path to root
  24. ## Disable all methods besides HEAD, GET and POST.
  25. if ($request_method !~ ^(GET|HEAD|POST)$ ) {
  26. return 444;
  27. }
  28. ## Add index.php to the list if you are using PHP
  29. index index.php index.html index.htm;
  30. ## Include certbot fix
  31. include /etc/nginx/snippets/nginx.well-known.conf;
  32. ## Include ssl
  33. include /etc/nginx/snippets/nginx.ssl.conf;
  34. ### Deny Stuffs ### {{{
  35. ## Protect specific TXT and config files
  36. location ~ /(\.|readme.html|readme.md|changelog.txt|changelog.md|contributing.txt|contributing.md|license.txt|license.md|legalnotice|privacy.txt|privacy.md|security.txt|security.md|sample-.*txt)
  37. {
  38. deny all;
  39. }
  40. ## Protect .git files
  41. location ~ /\.git/ {
  42. access_log off;
  43. log_not_found off;
  44. deny all;
  45. }
  46. ## Stop logging /theme
  47. location /theme {
  48. access_log off;
  49. }
  50. ### End Deny Stuffs ### }}}
  51. ### Rate Limit ### {{{
  52. limit_req zone=perip burst=100 nodelay;
  53. limit_req zone=perserver burst=5000;
  54. ### End Rate Limit ### }}}
  55. ### php attempt ### {{{
  56. ## Pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
  57. location ~ \.php$ {
  58. try_files $uri =404;
  59. fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
  60. fastcgi_index index.php;
  61. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  62. include fastcgi_params;
  63. }
  64. ### End php ### }}}
  65. ### Error Redirects ### {{{
  66. ## Redirect server error pages
  67. error_page 500 501 502 503 504 /pages/50x;
  68. error_page 404 /pages/404;
  69. error_page 403 /pages/403;
  70. ### End Error ### }}}
  71. }