web_system.tpl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. server {
  2. listen %ip%:%web_port%;
  3. server_name %domain% %alias%;
  4. root /var/lib/roundcube;
  5. index index.php index.html index.htm;
  6. error_log /var/log/nginx/domains/%domain%.error.log;
  7. access_log /var/log/nginx/domains/%domain%.access.log;
  8. include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
  9. location =/ {
  10. try_files $uri $uri/ /index.php?q=$uri&$args;
  11. }
  12. location / {
  13. 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)$ {
  14. expires 7d;
  15. fastcgi_hide_header "Set-Cookie";
  16. }
  17. }
  18. location ~ /(config|temp|logs) {
  19. deny all;
  20. return 404;
  21. }
  22. location ~ /\.(?!well-known\/) {
  23. deny all;
  24. return 404;
  25. }
  26. location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
  27. deny all;
  28. return 404;
  29. }
  30. location ~ ^/(bin|SQL)/ {
  31. deny all;
  32. return 404;
  33. }
  34. location ~ /\. {
  35. return 404;
  36. deny all;
  37. access_log off;
  38. log_not_found off;
  39. }
  40. location ~ ^/(.*\.php)$ {
  41. alias /var/lib/roundcube/$1;
  42. fastcgi_pass 127.0.0.1:9000;
  43. fastcgi_index index.php;
  44. include fastcgi_params;
  45. fastcgi_param SCRIPT_FILENAME $request_filename;
  46. }
  47. error_page 403 /error/404.html;
  48. error_page 404 /error/404.html;
  49. error_page 500 502 503 504 505 /error/50x.html;
  50. location /error/ {
  51. alias /var/www/document_errors/;
  52. }
  53. include %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*;
  54. }