web_system.stpl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. ssl_stapling on;
  11. ssl_stapling_verify on;
  12. # TLS 1.3 0-RTT anti-replay
  13. if ($anti_replay = 307) { return 307 https://$host$request_uri; }
  14. if ($anti_replay = 425) { return 425; }
  15. location ~ /\.(?!well-known\/) {
  16. deny all;
  17. return 404;
  18. }
  19. location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
  20. deny all;
  21. return 404;
  22. }
  23. location / {
  24. try_files $uri $uri/ =404;
  25. 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)$ {
  26. expires 7d;
  27. fastcgi_hide_header "Set-Cookie";
  28. }
  29. location ~ ^/(.*\.php)$ {
  30. include /etc/nginx/fastcgi_params;
  31. fastcgi_index index.php;
  32. fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
  33. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  34. fastcgi_pass unix:/run/php/www.sock;
  35. }
  36. }
  37. location /error/ {
  38. alias /var/www/document_errors/;
  39. }
  40. proxy_hide_header Upgrade;
  41. include %home%/%user%/conf/mail/%root_domain%/%web_system%.ssl.conf_*;
  42. }