forgejo.stpl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #=========================================================================#
  2. # Default Web Domain Template #
  3. # DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
  4. # https://hestiacp.com/docs/server-administration/web-templates.html #
  5. #=========================================================================#
  6. server {
  7. listen %ip%:%web_ssl_port% ssl;
  8. server_name %domain_idn% %alias_idn%;
  9. root %sdocroot%;
  10. index index.php index.html index.htm;
  11. access_log /var/log/nginx/domains/%domain%.log combined;
  12. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  13. error_log /var/log/nginx/domains/%domain%.error.log error;
  14. ssl_certificate %ssl_pem%;
  15. ssl_certificate_key %ssl_key%;
  16. #Commented out ssl_stapling directives due to Lets Encrypt ending OCSP support in 2025
  17. #ssl_stapling on;
  18. #ssl_stapling_verify on;
  19. # TLS 1.3 0-RTT anti-replay
  20. if ($anti_replay = 307) { return 307 https://$host$request_uri; }
  21. if ($anti_replay = 425) { return 425; }
  22. include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
  23. location ~ /\.(?!well-known\/) {
  24. deny all;
  25. return 404;
  26. }
  27. location / {
  28. client_max_body_size 512M;
  29. proxy_max_temp_file_size 0;
  30. proxy_read_timeout 120;
  31. proxy_redirect off;
  32. proxy_set_header Host $http_host;
  33. proxy_set_header Early-Data $rfc_early_data;
  34. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  35. proxy_set_header X-Forwarded-Proto $scheme;
  36. proxy_set_header X-Real-IP $remote_addr;
  37. proxy_pass http://localhost:3000;
  38. }
  39. location /error/ {
  40. alias %home%/%user%/web/%domain%/document_errors/;
  41. }
  42. location /vstats/ {
  43. alias %home%/%user%/web/%domain%/stats/;
  44. include %home%/%user%/web/%domain%/stats/auth.conf*;
  45. }
  46. proxy_hide_header Upgrade;
  47. include /etc/nginx/conf.d/phpmyadmin.inc*;
  48. include /etc/nginx/conf.d/phppgadmin.inc*;
  49. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  50. }