Skip to content

Commit d1fea85

Browse files
author
Kristan Kenney
committed
Merge branch 'mail-web' into develop
2 parents 79b976b + 8685891 commit d1fea85

File tree

2 files changed

+52
-43
lines changed

2 files changed

+52
-43
lines changed
Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
server {
22
listen %ip%:%proxy_port%;
33
server_name %domain% %alias%;
4-
5-
include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
4+
root /var/lib/roundcube;
5+
index index.php;
66
7-
location / {
8-
proxy_pass http://%ip%:%web_port%;
9-
location ~* ^.+\.(jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,html,htm)$ {
10-
alias /var/lib/roundcube/;
11-
expires 15m;
12-
try_files $uri @fallback;
13-
}
7+
include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
8+
9+
location ~ /(config|temp|logs) {
10+
deny all
11+
return 404;
1412
}
15-
16-
location /error/ {
17-
alias %home%/%user%/web/%root_domain%/document_errors/;
13+
14+
location ~ /\.(?!well-known\/) {
15+
deny all;
16+
return 404;
1817
}
1918

20-
location ~ /(config|temp|logs) {
21-
return 404;
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+
}
2226
}
2327

2428
location ~ ^/(.*\.php)$ {
@@ -30,14 +34,16 @@ server {
3034
}
3135

3236
location @fallback {
33-
proxy_pass http://%ip%:%web_port%;
37+
proxy_pass http://%ip%:%web_port%;
3438
}
3539

36-
location ~ /\.ht {return 404;}
37-
location ~ /\.svn/ {return 404;}
38-
location ~ /\.git/ {return 404;}
39-
location ~ /\.hg/ {return 404;}
40-
location ~ /\.bzr/ {return 404;}
40+
error_page 403 /error/404.html;
41+
error_page 404 /error/404.html;
42+
error_page 500 502 503 504 /error/50x.html;
43+
44+
location /error/ {
45+
alias %home%/%user%/web/%root_domain%/document_errors/;
46+
}
4147

4248
include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.conf_*;
43-
}
49+
}
Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
server {
22
listen %ip%:%web_ssl_port% ssl http2;
33
server_name %domain% %alias%;
4-
root /var/lib/roundcube;
5-
index index.php;
6-
74
ssl_certificate %ssl_pem%;
85
ssl_certificate_key %ssl_key%;
9-
error_log /var/log/%web_system%/domains/%domain%.error.log error;
10-
11-
location / {
12-
try_files $uri $uri/ /index.php?$args;
13-
location ~* ^.+\.(jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,html,htm)$ {
14-
alias /var/lib/roundcube/;
15-
expires 15m;
16-
}
6+
root /var/lib/roundcube;
7+
index index.php;
8+
9+
location ~ /(config|temp|logs) {
10+
deny all
11+
return 404;
1712
}
18-
19-
location /error/ {
20-
alias %home%/%user%/web/%root_domain%/document_errors/;
13+
14+
location ~ /\.(?!well-known\/) {
15+
deny all;
16+
return 404;
2117
}
2218

23-
location ~ /(config|temp|logs) {
24-
return 404;
19+
location / {
20+
try_files $uri $uri/ /index.php?$args;
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+
fastcgi_hide_header "Set-Cookie";
25+
}
2526
}
2627

2728
location ~ ^/(.*\.php)$ {
@@ -32,11 +33,13 @@ server {
3233
fastcgi_param SCRIPT_FILENAME $request_filename;
3334
}
3435

35-
location ~ /\.ht {return 404;}
36-
location ~ /\.svn/ {return 404;}
37-
location ~ /\.git/ {return 404;}
38-
location ~ /\.hg/ {return 404;}
39-
location ~ /\.bzr/ {return 404;}
36+
error_page 403 /error/404.html;
37+
error_page 404 /error/404.html;
38+
error_page 500 502 503 504 /error/50x.html;
39+
40+
location /error/ {
41+
alias %home%/%user%/web/%root_domain%/document_errors/;
42+
}
4043

41-
include %home%/%user%/conf/mail/%root_domain%/%web_system%.ssl.conf_*;
44+
include %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*;
4245
}

0 commit comments

Comments
 (0)