default.stpl 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. server {
  2. listen %ip%:%proxy_ssl_port% ssl http2;
  3. server_name %domain% %alias%;
  4. ssl_certificate %ssl_pem%;
  5. ssl_certificate_key %ssl_key%;
  6. root /var/lib/roundcube;
  7. index index.php index.html index.htm;
  8. error_log /var/log/nginx/domains/%domain%.error.log;
  9. access_log /var/log/nginx/domains/%domain%.access.log;
  10. location / {
  11. proxy_pass http://%ip%:%web_port%;
  12. try_files $uri $uri/ /index.php?q=$uri&$args;
  13. alias /var/lib/roundcube/;
  14. location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
  15. expires 7d;
  16. fastcgi_hide_header "Set-Cookie";
  17. }
  18. }
  19. location ~ /(config|temp|logs) {
  20. deny all;
  21. return 404;
  22. }
  23. location ~ /\.(?!well-known\/) {
  24. deny all;
  25. return 404;
  26. }
  27. location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
  28. deny all;
  29. return 404;
  30. }
  31. location ~ ^/(bin|SQL)/ {
  32. deny all;
  33. return 404;
  34. }
  35. location ~ /\. {
  36. return 404;
  37. deny all;
  38. access_log off;
  39. log_not_found off;
  40. }
  41. location ~ ^/(.*\.php)$ {
  42. alias /var/lib/roundcube/$1;
  43. fastcgi_pass 127.0.0.1:9000;
  44. fastcgi_index index.php;
  45. include fastcgi_params;
  46. fastcgi_param SCRIPT_FILENAME $request_filename;
  47. fastcgi_param HTTPS on;
  48. }
  49. error_page 403 /error/404.html;
  50. error_page 404 /error/404.html;
  51. error_page 500 502 503 504 505 /error/50x.html;
  52. location /error/ {
  53. alias /var/www/document_errors/;
  54. }
  55. location @fallback {
  56. proxy_pass http://%ip%:%web_port%;
  57. }
  58. include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.conf_*;
  59. }