@@ -2,10 +2,23 @@ server {
22 listen % ip% :% proxy_port% ;
33 server_name % domain% % alias% ;
44 root /var/lib/roundcube;
5- index index.php;
5+ index index.php index.html index.htm;
6+
7+ error_log /var/log/nginx/domains/% domain% .error.log;
8+ access_log /var/log/nginx/domains/% domain% .access.log;
69
710 include % home% /% user% /conf/mail/% root_domain% /nginx.forcessl.conf*;
8-
11+
12+ location / {
13+ proxy_pass http://% ip% :% web_port% ;
14+ try_files $uri $uri / /index.php?q= $uri &$args ;
15+ alias /var/lib/roundcube/;
16+ 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)$ {
17+ expires 7d;
18+ fastcgi_hide_header " Set-Cookie" ;
19+ }
20+ }
21+
922 location ~ /(config|temp|logs) {
1023 deny all;
1124 return 404;
@@ -16,13 +29,21 @@ server {
1629 return 404;
1730 }
1831
19- location / {
20- proxy_pass http://% ip% :% web_port% ;
21- 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)$ {
22- alias /var/lib/roundcube/;
23- expires 1h;
24- try_files $uri @fallback;
25- }
32+ location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
33+ deny all;
34+ return 404;
35+ }
36+
37+ location ~ ^/(bin|SQL)/ {
38+ deny all;
39+ return 404;
40+ }
41+
42+ location ~ /\. {
43+ return 404;
44+ deny all;
45+ access_log off;
46+ log_not_found off;
2647 }
2748
2849 location ~ ^/(.*\.php)$ {
@@ -33,16 +54,16 @@ server {
3354 fastcgi_param SCRIPT_FILENAME $request_filename ;
3455 }
3556
36- location @fallback {
37- proxy_pass http://% ip% :% web_port% ;
38- }
39-
4057 error_page 403 /error/404.html;
4158 error_page 404 /error/404.html;
42- error_page 500 502 503 504 /error/50x.html;
43-
59+ error_page 500 502 503 504 505 /error/50x.html;
60+
4461 location /error/ {
45- alias % home% /% user% /web/% root_domain% /document_errors/;
62+ alias /var/www/document_errors/;
63+ }
64+
65+ location @fallback {
66+ proxy_pass http://% ip% :% web_port% ;
4667 }
4768
4869 include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.conf_*;
0 commit comments