glowingbear 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ## glowing-bear site config
  2. server {
  3. ## Redirect http to https
  4. listen 80;
  5. listen [::]:80;
  6. server_name glow.demu.red;
  7. return 301 https://$host$request_uri;
  8. }
  9. server {
  10. listen 443 ssl;
  11. listen [::]:443 ssl;
  12. server_name glow.demu.red;
  13. root /var/www/glowing-bear;
  14. access_log /var/log/nginx/glow_access.log;
  15. error_log /var/log/nginx/glow_error.log;
  16. ## Lock Down Access
  17. #auth_basic "Authorized Access Only";
  18. #auth_basic_user_file /var/www/glowing-bear/.htpasswd;
  19. ## Disable all methods besides HEAD, GET and POST.
  20. if ($request_method !~ ^(GET|HEAD|POST)$ ) {
  21. return 444;
  22. }
  23. index index.html;
  24. ## Include certbot fix
  25. include /etc/nginx/snippets/nginx.well-known.conf;
  26. ## Include ssl
  27. include /etc/nginx/snippets/nginx.ssl.conf;
  28. ### Deny Stuffs ### {{{
  29. ## Protect specific TXT and config files
  30. 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)
  31. {
  32. deny all;
  33. }
  34. ## Protect .git files
  35. location ~ /\.git/ {
  36. access_log off;
  37. log_not_found off;
  38. deny all;
  39. }
  40. ### End Deny Stuffs ### }}}
  41. ## Error Redirects
  42. error_page 403 /error.html;
  43. error_page 404 /error.html;
  44. error_page 405 /error.html;
  45. error_page 500 501 502 503 504 /error.html;
  46. location = /error.html {
  47. root /var/www/error;
  48. internal;
  49. }
  50. }