Make path to admin and webmail configurable, related to #236

This commit is contained in:
kaiyou
2017-09-24 18:16:36 +02:00
parent 648d092e88
commit 4521fa9e29
2 changed files with 17 additions and 7 deletions

View File

@@ -57,19 +57,19 @@ http {
return 301 $scheme://$host/webmail/;
}
location /webmail {
rewrite ^/webmail/(.*) /$1 break;
location {{ WEB_WEBMAIL }} {
rewrite ^{{ WEB_WEBMAIL }}/(.*) /$1 break;
proxy_pass http://webmail;
}
{% endif %}
{% if ADMIN == 'true' %}
location /admin {
return 301 $scheme://$host/admin/ui;
location {{ WEB_ADMIN }} {
return 301 $scheme://$host{{ WEB_ADMIN }}/ui;
}
location ~ /admin/(ui|static) {
rewrite ^/admin/(.*) /$1 break;
proxy_set_header X-Forwarded-Prefix /admin;
location ~ {{ WEB_ADMIN }}/(ui|static) {
rewrite ^{{ WEB_ADMIN }}/(.*) /$1 break;
proxy_set_header X-Forwarded-Prefix {{ WEB_ADMIN }};
proxy_pass http://admin;
}
{% endif %}