default_snappymail.tpl 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. server {
  2. listen %ip%:%proxy_port%;
  3. server_name %domain_idn% %alias_idn%;
  4. root /var/lib/snappymail;
  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. include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
  9. location ~ /\.(?!well-known\/) {
  10. deny all;
  11. return 404;
  12. }
  13. location ^~ /data {
  14. deny all;
  15. return 404;
  16. }
  17. location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
  18. deny all;
  19. return 404;
  20. }
  21. location / {
  22. alias /var/lib/snappymail/;
  23. try_files $uri $uri/ =404;
  24. proxy_pass http://%ip%:%web_port%;
  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. }
  30. location @fallback {
  31. proxy_pass http://%ip%:%web_port%;
  32. }
  33. location /error/ {
  34. alias /var/www/document_errors/;
  35. }
  36. include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.conf_*;
  37. }