web_system.stpl 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. server {
  2. listen %ip%:%web_ssl_port% ssl;
  3. server_name %domain_idn% %alias_idn%;
  4. root /var/lib/roundcube;
  5. index index.php index.html index.htm;
  6. access_log /var/log/nginx/domains/%domain%.log combined;
  7. error_log /var/log/nginx/domains/%domain%.error.log error;
  8. ssl_certificate %ssl_pem%;
  9. ssl_certificate_key %ssl_key%;
  10. #Commented out ssl_stapling directives due to Lets Encrypt ending OCSP support in 2025
  11. #ssl_stapling on;
  12. #ssl_stapling_verify on;
  13. # TLS 1.3 0-RTT anti-replay
  14. if ($anti_replay = 307) { return 307 https://$host$request_uri; }
  15. if ($anti_replay = 425) { return 425; }
  16. location ~ /\.(?!well-known\/) {
  17. deny all;
  18. return 404;
  19. }
  20. location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
  21. deny all;
  22. return 404;
  23. }
  24. location / {
  25. try_files $uri $uri/ =404;
  26. 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)$ {
  27. expires 7d;
  28. fastcgi_hide_header "Set-Cookie";
  29. }
  30. location ~ ^/(.*\.php)$ {
  31. include /etc/nginx/fastcgi_params;
  32. fastcgi_index index.php;
  33. fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
  34. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  35. fastcgi_pass unix:/run/php/www.sock;
  36. }
  37. }
  38. location /error/ {
  39. alias /var/www/document_errors/;
  40. }
  41. proxy_hide_header Upgrade;
  42. include %home%/%user%/conf/mail/%root_domain%/%web_system%.ssl.conf_*;
  43. }