Skip to content

Commit da2550a

Browse files
author
Kristan Kenney
committed
Fix webmail alias for php-fpm configurations
1 parent bbf6723 commit da2550a

File tree

4 files changed

+28
-25
lines changed

4 files changed

+28
-25
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ 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

99
location / {
1010
proxy_pass http://%ip%:%web_port%;
@@ -44,18 +44,20 @@ server {
4444
fastcgi_index index.php;
4545
include fastcgi_params;
4646
fastcgi_param SCRIPT_FILENAME $request_filename;
47+
fastcgi_param HTTPS on;
4748
}
4849

49-
location @fallback {
50-
proxy_pass http://%ip%:%web_port%;
51-
}
52-
5350
error_page 403 /error/404.html;
5451
error_page 404 /error/404.html;
55-
error_page 500 502 503 504 /error/50x.html;
56-
52+
error_page 500 502 503 504 505 /error/50x.html;
53+
5754
location /error/ {
58-
alias /var/www/document_errors/;
55+
alias /var/www/document_errors/;
56+
try_files $uri $uri/;
57+
}
58+
59+
location @fallback {
60+
proxy_pass http://%ip%:%web_port%;
5961
}
6062

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

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ 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;
66
77
include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
88
@@ -46,16 +46,17 @@ server {
4646
fastcgi_param SCRIPT_FILENAME $request_filename;
4747
}
4848

49-
location @fallback {
50-
proxy_pass http://%ip%:%web_port%;
51-
}
52-
5349
error_page 403 /error/404.html;
5450
error_page 404 /error/404.html;
55-
error_page 500 502 503 504 /error/50x.html;
51+
error_page 500 502 503 504 505 /error/50x.html;
5652

5753
location /error/ {
58-
alias /var/www/document_errors/;
54+
alias /var/www/document_errors/;
55+
try_files $uri $uri/;
56+
}
57+
58+
location @fallback {
59+
proxy_pass http://%ip%:%web_port%;
5960
}
6061

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

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ 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

99
location =/ {
1010
try_files $uri $uri/ /index.php?q=$uri&$args;
1111
}
1212

1313
location / {
14-
try_files $uri $uri/ /index.php?q=$uri&$args;
1514
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)$ {
1615
expires 1h;
1716
fastcgi_hide_header "Set-Cookie";
@@ -46,14 +45,16 @@ server {
4645
fastcgi_index index.php;
4746
include fastcgi_params;
4847
fastcgi_param SCRIPT_FILENAME $request_filename;
48+
fastcgi_param HTTPS on;
4949
}
5050

5151
error_page 403 /error/404.html;
5252
error_page 404 /error/404.html;
53-
error_page 500 502 503 504 /error/50x.html;
53+
error_page 500 502 503 504 505 /error/50x.html;
5454

5555
location /error/ {
56-
alias /var/www/document_errors/;
56+
alias /var/www/document_errors/;
57+
try_files $uri $uri/;
5758
}
5859

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

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ 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;
66
77
include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
88
@@ -11,8 +11,7 @@ server {
1111
}
1212

1313
location / {
14-
try_files $uri $uri/ /index.php?q=$uri&$args;
15-
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+
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)$ {
1615
expires 1h;
1716
fastcgi_hide_header "Set-Cookie";
1817
}
@@ -50,11 +49,11 @@ server {
5049

5150
error_page 403 /error/404.html;
5251
error_page 404 /error/404.html;
53-
error_page 500 502 503 504 /error/50x.html;
52+
error_page 500 502 503 504 505 /error/50x.html;
5453

5554
location /error/ {
56-
alias /var/www/document_errors/;
57-
55+
alias /var/www/document_errors/;
56+
try_files $uri $uri/;
5857
}
5958

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

0 commit comments

Comments
 (0)