wordpress-http3.stpl 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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% quic;
  8. listen %ip%:%web_ssl_port% ssl;
  9. server_name %domain_idn% %alias_idn%;
  10. root %sdocroot%;
  11. index index.php index.html index.htm;
  12. access_log /var/log/nginx/domains/%domain%.log combined;
  13. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  14. error_log /var/log/nginx/domains/%domain%.error.log error;
  15. ssl_certificate %ssl_pem%;
  16. ssl_certificate_key %ssl_key%;
  17. #Commented out ssl_stapling directives due to Lets Encrypt ending OCSP support in 2025
  18. #ssl_stapling on;
  19. #ssl_stapling_verify on;
  20. # TLS 1.3 0-RTT anti-replay
  21. if ($anti_replay = 307) { return 307 https://$host$request_uri; }
  22. if ($anti_replay = 425) { return 425; }
  23. # Add support to HTTP/3
  24. add_header Alt-Svc 'h3=":$server_port"; ma=86400';
  25. include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
  26. location = /favicon.ico {
  27. log_not_found off;
  28. access_log off;
  29. }
  30. location = /robots.txt {
  31. try_files $uri $uri/ /index.php?$args;
  32. log_not_found off;
  33. access_log off;
  34. }
  35. location ~ /\.(?!well-known\/) {
  36. deny all;
  37. return 404;
  38. }
  39. location / {
  40. try_files $uri $uri/ /index.php?$args;
  41. location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
  42. expires 30d;
  43. fastcgi_hide_header "Set-Cookie";
  44. }
  45. location ~* /(?:uploads|files)/.*.php$ {
  46. deny all;
  47. return 404;
  48. }
  49. location ~ [^/]\.php(/|$) {
  50. try_files $uri =404;
  51. include /etc/nginx/fastcgi_params;
  52. fastcgi_index index.php;
  53. fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
  54. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  55. fastcgi_param HTTP_HOST $host;
  56. fastcgi_pass %backend_lsnr%;
  57. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  58. if ($request_uri ~* "/wp-admin/|/wp-json/|wp-.*.php|xmlrpc.php|index.php|/store.*|/cart.*|/my-account.*|/checkout.*") {
  59. set $no_cache 1;
  60. }
  61. if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart|woocommerce_cart_hash|PHPSESSID") {
  62. set $no_cache 1;
  63. }
  64. }
  65. }
  66. location /error/ {
  67. alias %home%/%user%/web/%domain%/document_errors/;
  68. }
  69. location /vstats/ {
  70. alias %home%/%user%/web/%domain%/stats/;
  71. include %home%/%user%/web/%domain%/stats/auth.conf*;
  72. }
  73. include /etc/nginx/conf.d/phpmyadmin.inc*;
  74. include /etc/nginx/conf.d/phppgadmin.inc*;
  75. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  76. }