craftcms.stpl 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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%/web;
  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 = /favicon.ico {
  24. log_not_found off;
  25. access_log off;
  26. }
  27. location = /robots.txt {
  28. allow all;
  29. log_not_found off;
  30. access_log off;
  31. }
  32. location ~ /\.(?!well-known\/) {
  33. deny all;
  34. return 404;
  35. }
  36. location / {
  37. try_files $uri $uri/ /index.php?$args;
  38. 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)$ {
  39. expires 30d;
  40. fastcgi_hide_header "Set-Cookie";
  41. }
  42. # Craft-specific location handlers to ensure AdminCP requests route through index.php
  43. # If you change your "cpTrigger", change it here as well
  44. location ^~ /admin {
  45. try_files $uri $uri/ /index.php?$query_string;
  46. }
  47. location ^~ /cpresources {
  48. try_files $uri $uri/ /index.php?$query_string;
  49. }
  50. location ~ [^/]\.php(/|$) {
  51. try_files $uri =404;
  52. include /etc/nginx/fastcgi_params;
  53. fastcgi_index index.php;
  54. fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
  55. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  56. fastcgi_pass %backend_lsnr%;
  57. }
  58. }
  59. location /error/ {
  60. alias %home%/%user%/web/%domain%/document_errors/;
  61. }
  62. location /vstats/ {
  63. alias %home%/%user%/web/%domain%/stats/;
  64. include %home%/%user%/web/%domain%/stats/auth.conf*;
  65. }
  66. proxy_hide_header Upgrade;
  67. include /etc/nginx/conf.d/phpmyadmin.inc*;
  68. include /etc/nginx/conf.d/phppgadmin.inc*;
  69. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  70. }