Skip to content

Commit 84c3c60

Browse files
author
Kristan Kenney
committed
Merge branch 'bugfix-mail-nginx' into develop
2 parents b8cb790 + 6600c50 commit 84c3c60

File tree

4 files changed

+51
-110
lines changed

4 files changed

+51
-110
lines changed

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

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,31 @@
11
server {
22
listen %ip%:%proxy_ssl_port% ssl http2;
33
server_name %domain% %alias%;
4-
ssl_certificate %ssl_pem%;
5-
ssl_certificate_key %ssl_key%;
4+
ssl_certificate %ssl_pem%;
5+
ssl_certificate_key %ssl_key%;
66
root /var/lib/roundcube;
77
index index.php index.html index.htm;
8+
access_log /var/log/nginx/domains/%domain%.log combined;
9+
error_log /var/log/nginx/domains/%domain%.error.log error;
810

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-
22-
location ~ /(config|temp|logs) {
23-
deny all;
24-
return 404;
25-
}
26-
2711
location ~ /\.(?!well-known\/) {
2812
deny all;
2913
return 404;
3014
}
3115

32-
location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
16+
location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
3317
deny all;
3418
return 404;
3519
}
3620

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;
21+
location / {
22+
proxy_pass https://%ip%:%web_ssl_port%;
23+
try_files $uri $uri/ /index.php?q=$uri&$args;
24+
alias /var/lib/roundcube/;
25+
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)$ {
26+
expires 7d;
27+
fastcgi_hide_header "Set-Cookie";
28+
}
4729
}
4830

4931
location ~ ^/(.*\.php)$ {
@@ -52,19 +34,18 @@ server {
5234
fastcgi_index index.php;
5335
include fastcgi_params;
5436
fastcgi_param SCRIPT_FILENAME $request_filename;
55-
fastcgi_param HTTPS on;
5637
}
57-
38+
5839
error_page 403 /error/404.html;
5940
error_page 404 /error/404.html;
6041
error_page 500 502 503 504 505 /error/50x.html;
61-
42+
6243
location /error/ {
63-
alias /var/www/document_errors/;
44+
alias /var/www/document_errors/;
6445
}
6546

6647
location @fallback {
67-
proxy_pass http://%ip%:%web_port%;
48+
proxy_pass https://%ip%:%web_ssl_port%;
6849
}
6950

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

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

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,29 @@ server {
33
server_name %domain% %alias%;
44
root /var/lib/roundcube;
55
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;
6+
access_log /var/log/nginx/domains/%domain%.log combined;
7+
error_log /var/log/nginx/domains/%domain%.error.log error;
98
109
include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
1110
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-
22-
location ~ /(config|temp|logs) {
23-
deny all;
24-
return 404;
25-
}
26-
2711
location ~ /\.(?!well-known\/) {
2812
deny all;
2913
return 404;
3014
}
3115

32-
location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
16+
location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
3317
deny all;
3418
return 404;
3519
}
3620

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;
21+
location / {
22+
proxy_pass http://%ip%:%web_port%;
23+
try_files $uri $uri/ /index.php?q=$uri&$args;
24+
alias /var/lib/roundcube/;
25+
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)$ {
26+
expires 7d;
27+
fastcgi_hide_header "Set-Cookie";
28+
}
4729
}
4830

4931
location ~ ^/(.*\.php)$ {
@@ -53,13 +35,13 @@ server {
5335
include fastcgi_params;
5436
fastcgi_param SCRIPT_FILENAME $request_filename;
5537
}
56-
38+
5739
error_page 403 /error/404.html;
5840
error_page 404 /error/404.html;
5941
error_page 500 502 503 504 505 /error/50x.html;
6042

6143
location /error/ {
62-
alias /var/www/document_errors/;
44+
alias /var/www/document_errors/;
6345
}
6446

6547
location @fallback {

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

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,29 @@
11
server {
22
listen %ip%:%web_ssl_port% ssl http2;
33
server_name %domain% %alias%;
4-
ssl_certificate %ssl_pem%;
5-
ssl_certificate_key %ssl_key%;
4+
ssl_certificate %ssl_pem%;
5+
ssl_certificate_key %ssl_key%;
66
root /var/lib/roundcube;
77
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;
8+
access_log /var/log/nginx/domains/%domain%.log combined;
9+
error_log /var/log/nginx/domains/%domain%.error.log error;
1110

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-
23-
location ~ /(config|temp|logs) {
24-
deny all;
25-
return 404;
26-
}
27-
2811
location ~ /\.(?!well-known\/) {
2912
deny all;
3013
return 404;
3114
}
32-
33-
location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
34-
deny all;
35-
return 404;
36-
}
3715

38-
location ~ ^/(bin|SQL)/ {
16+
location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
3917
deny all;
4018
return 404;
4119
}
42-
43-
location ~ /\. {
44-
return 404;
45-
deny all;
46-
access_log off;
47-
log_not_found off;
20+
21+
location / {
22+
try_files $uri $uri/ /index.php?q=$uri&$args;
23+
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)$ {
24+
expires 7d;
25+
fastcgi_hide_header "Set-Cookie";
26+
}
4827
}
4928

5029
location ~ ^/(.*\.php)$ {
@@ -53,15 +32,14 @@ server {
5332
fastcgi_index index.php;
5433
include fastcgi_params;
5534
fastcgi_param SCRIPT_FILENAME $request_filename;
56-
fastcgi_param HTTPS on;
5735
}
58-
36+
5937
error_page 403 /error/404.html;
6038
error_page 404 /error/404.html;
6139
error_page 500 502 503 504 505 /error/50x.html;
6240

6341
location /error/ {
64-
alias /var/www/document_errors/;
42+
alias /var/www/document_errors/;
6543
}
6644

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

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ server {
44
root /var/lib/roundcube;
55
index index.php index.html index.htm;
66
access_log /var/log/nginx/domains/%domain%.log combined;
7-
error_log /var/log/nginx/domains/%domain%.error.log error;
7+
error_log /var/log/nginx/domains/%domain%.error.log error;
88
99
include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
10-
10+
1111
location ~ /\.(?!well-known\/) {
1212
deny all;
1313
return 404;
1414
}
15-
15+
1616
location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
1717
deny all;
1818
return 404;
1919
}
20-
20+
2121
location / {
22-
try_files $uri $uri/ /index.php?q=$uri&$args;
23-
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+
try_files $uri $uri/ /index.php?q=$uri&$args;
23+
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)$ {
2424
expires 7d;
2525
fastcgi_hide_header "Set-Cookie";
2626
}
@@ -33,7 +33,7 @@ server {
3333
include fastcgi_params;
3434
fastcgi_param SCRIPT_FILENAME $request_filename;
3535
}
36-
36+
3737
error_page 403 /error/404.html;
3838
error_page 404 /error/404.html;
3939
error_page 500 502 503 504 505 /error/50x.html;

0 commit comments

Comments
 (0)