default.stpl 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. server {
  2. listen %ip%:%proxy_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. alias /var/lib/roundcube/;
  25. try_files $uri $uri/ =404;
  26. proxy_pass https://%ip%:%web_ssl_port%;
  27. 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)$ {
  28. expires 7d;
  29. fastcgi_hide_header "Set-Cookie";
  30. }
  31. }
  32. location @fallback {
  33. proxy_pass https://%ip%:%web_ssl_port%;
  34. }
  35. location /error/ {
  36. alias /var/www/document_errors/;
  37. }
  38. proxy_hide_header Upgrade;
  39. include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.ssl.conf_*;
  40. }