thunder.stpl 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. server {
  2. listen %ip%:%web_ssl_port% ssl;
  3. server_name %domain_idn% %alias_idn%;
  4. root %sdocroot%/docroot;
  5. index index.php index.html index.htm;
  6. access_log /var/log/nginx/domains/%domain%.log combined;
  7. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  8. error_log /var/log/nginx/domains/%domain%.error.log error;
  9. ssl_certificate %ssl_pem%;
  10. ssl_certificate_key %ssl_key%;
  11. #Commented out ssl_stapling directives due to Lets Encrypt ending OCSP support in 2025
  12. #ssl_stapling on;
  13. #ssl_stapling_verify on;
  14. # TLS 1.3 0-RTT anti-replay
  15. if ($anti_replay = 307) { return 307 https://$host$request_uri; }
  16. if ($anti_replay = 425) { return 425; }
  17. include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
  18. location = /favicon.ico {
  19. log_not_found off;
  20. access_log off;
  21. }
  22. location = /robots.txt {
  23. allow all;
  24. log_not_found off;
  25. access_log off;
  26. }
  27. location ~ ^/sites/.*/private/ {
  28. deny all;
  29. return 404;
  30. }
  31. location ~ /\.(?!well-known\/) {
  32. deny all;
  33. return 404;
  34. }
  35. location / {
  36. try_files $uri $uri/ /index.php?$query_string;
  37. 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)$ {
  38. try_files $uri @rewrite;
  39. expires 30d;
  40. fastcgi_hide_header "Set-Cookie";
  41. }
  42. location ~ \..*/.*\.php$ {
  43. deny all;
  44. return 404;
  45. }
  46. location ~ ^/sites/[^/]+/files/.*\.php$ {
  47. deny all;
  48. return 404;
  49. }
  50. location ~ [^/]\.php(/|$)|^/update.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_split_path_info ^(.+?\.php)(|/.*)$;
  57. fastcgi_pass %backend_lsnr%;
  58. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  59. }
  60. location ~ ^/sites/.*/files/styles/ {
  61. try_files $uri @rewrite;
  62. }
  63. }
  64. location @rewrite {
  65. rewrite ^/(.*)$ /index.php?q=$1;
  66. }
  67. rewrite ^/index.php/(.*) /$1 permanent;
  68. location /error/ {
  69. alias %home%/%user%/web/%domain%/document_errors/;
  70. }
  71. location /vstats/ {
  72. alias %home%/%user%/web/%domain%/stats/;
  73. include %home%/%user%/web/%domain%/stats/auth.conf*;
  74. }
  75. proxy_hide_header Upgrade;
  76. include /etc/nginx/conf.d/phpmyadmin.inc*;
  77. include /etc/nginx/conf.d/phppgadmin.inc*;
  78. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  79. }