Skip to content

Commit 7aa6aea

Browse files
author
Kristan Kenney
committed
Merge branch 'develop' into webui-refresh-winterfell
2 parents 2c42710 + 1ff3fc6 commit 7aa6aea

File tree

5 files changed

+143
-52
lines changed

5 files changed

+143
-52
lines changed

install/deb/templates/mail/nginx/default.stpl

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,21 @@ server {
44
ssl_certificate %ssl_pem%;
55
ssl_certificate_key %ssl_key%;
66
root /var/lib/roundcube;
7-
index index.php;
8-
7+
index index.php index.html index.htm;
8+
9+
error_log /var/log/nginx/domains/%domain%.error.log;
10+
access_log /var/log/nginx/domains/%domain%.access.log;
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)$ {
@@ -31,18 +52,19 @@ server {
3152
fastcgi_index index.php;
3253
include fastcgi_params;
3354
fastcgi_param SCRIPT_FILENAME $request_filename;
55+
fastcgi_param HTTPS on;
3456
}
3557

36-
location @fallback {
37-
proxy_pass http://%ip%:%web_port%;
38-
}
39-
4058
error_page 403 /error/404.html;
4159
error_page 404 /error/404.html;
42-
error_page 500 502 503 504 /error/50x.html;
60+
error_page 500 502 503 504 505 /error/50x.html;
4361

4462
location /error/ {
45-
alias %home%/%user%/web/%root_domain%/document_errors/;
63+
alias /var/www/document_errors/;
64+
}
65+
66+
location @fallback {
67+
proxy_pass http://%ip%:%web_port%;
4668
}
4769

4870
include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.conf_*;

install/deb/templates/mail/nginx/default.tpl

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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_*;

install/deb/templates/mail/nginx/web_system.stpl

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,22 @@ server {
44
ssl_certificate %ssl_pem%;
55
ssl_certificate_key %ssl_key%;
66
root /var/lib/roundcube;
7-
index index.php;
7+
index index.php index.html index.htm;
88

9+
error_log /var/log/nginx/domains/%domain%.error.log;
10+
access_log /var/log/nginx/domains/%domain%.access.log;
11+
12+
location =/ {
13+
try_files $uri $uri/ /index.php?q=$uri&$args;
14+
}
15+
16+
location / {
17+
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)$ {
18+
expires 7d;
19+
fastcgi_hide_header "Set-Cookie";
20+
}
21+
}
22+
923
location ~ /(config|temp|logs) {
1024
deny all;
1125
return 404;
@@ -15,13 +29,22 @@ server {
1529
deny all;
1630
return 404;
1731
}
32+
33+
location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
34+
deny all;
35+
return 404;
36+
}
1837

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-
expires 1h;
23-
fastcgi_hide_header "Set-Cookie";
24-
}
38+
location ~ ^/(bin|SQL)/ {
39+
deny all;
40+
return 404;
41+
}
42+
43+
location ~ /\. {
44+
return 404;
45+
deny all;
46+
access_log off;
47+
log_not_found off;
2548
}
2649

2750
location ~ ^/(.*\.php)$ {
@@ -30,14 +53,15 @@ server {
3053
fastcgi_index index.php;
3154
include fastcgi_params;
3255
fastcgi_param SCRIPT_FILENAME $request_filename;
56+
fastcgi_param HTTPS on;
3357
}
3458

3559
error_page 403 /error/404.html;
3660
error_page 404 /error/404.html;
37-
error_page 500 502 503 504 /error/50x.html;
38-
61+
error_page 500 502 503 504 505 /error/50x.html;
62+
3963
location /error/ {
40-
alias %home%/%user%/web/%root_domain%/document_errors/;
64+
alias /var/www/document_errors/;
4165
}
4266

4367
include %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*;

install/deb/templates/mail/nginx/web_system.tpl

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,25 @@ server {
22
listen %ip%:%web_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+
8+
error_log /var/log/nginx/domains/%domain%.error.log;
9+
access_log /var/log/nginx/domains/%domain%.access.log;
610
711
include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
8-
12+
13+
location =/ {
14+
try_files $uri $uri/ /index.php?q=$uri&$args;
15+
}
16+
17+
location / {
18+
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)$ {
19+
expires 7d;
20+
fastcgi_hide_header "Set-Cookie";
21+
}
22+
}
23+
924
location ~ /(config|temp|logs) {
1025
deny all;
1126
return 404;
@@ -15,13 +30,22 @@ server {
1530
deny all;
1631
return 404;
1732
}
33+
34+
location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
35+
deny all;
36+
return 404;
37+
}
1838

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-
expires 1h;
23-
fastcgi_hide_header "Set-Cookie";
24-
}
39+
location ~ ^/(bin|SQL)/ {
40+
deny all;
41+
return 404;
42+
}
43+
44+
location ~ /\. {
45+
return 404;
46+
deny all;
47+
access_log off;
48+
log_not_found off;
2549
}
2650

2751
location ~ ^/(.*\.php)$ {
@@ -34,10 +58,10 @@ server {
3458

3559
error_page 403 /error/404.html;
3660
error_page 404 /error/404.html;
37-
error_page 500 502 503 504 /error/50x.html;
38-
61+
error_page 500 502 503 504 505 /error/50x.html;
62+
3963
location /error/ {
40-
alias %home%/%user%/web/%root_domain%/document_errors/;
64+
alias /var/www/document_errors/;
4165
}
4266

4367
include %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*;

0 commit comments

Comments
 (0)