Moved locations to correct area in nginx.conf.

master
Dimitri Huisman 3 years ago
parent aa7380ffba
commit eb74a72a52

@ -128,30 +128,12 @@ http {
include /overrides/*.conf; include /overrides/*.conf;
# Actual logic # Actual logic
{% if ADMIN == 'true' %}
location ^~ /ui {
include /etc/nginx/proxy.conf;
rewrite ^/ui/(.*) {{ WEB_ADMIN }}/ui/$1 redirect;
}
{% endif %}
{% if ADMIN == 'true' or WEBMAIL != 'none' %} {% if ADMIN == 'true' or WEBMAIL != 'none' %}
location ^~ /sso { location ^~ /sso {
include /etc/nginx/proxy.conf; include /etc/nginx/proxy.conf;
proxy_pass http://$admin; proxy_pass http://$admin;
} }
location ^~ /sso/static {
include /etc/nginx/proxy.conf;
rewrite /sso/static/(.*) /static/$1 permanent;
}
location ^~ {{ WEB_WEBMAIL }}/sso/ui/logout {
include /etc/nginx/proxy.conf;
rewrite ^{{ WEB_WEBMAIL }}/sso/ui/logout$ /sso/logout break;
proxy_pass http://$admin;
}
location ^~ /ui/language { location ^~ /ui/language {
include /etc/nginx/proxy.conf; include /etc/nginx/proxy.conf;
proxy_set_header X-Forwarded-Prefix {{ WEB_ADMIN }}; proxy_set_header X-Forwarded-Prefix {{ WEB_ADMIN }};
@ -159,17 +141,17 @@ http {
expires $expires; expires $expires;
} }
location ^~ /ui/webmail { location ^~ /sso/static {
include /etc/nginx/proxy.conf; include /etc/nginx/proxy.conf;
return 302 {{ WEB_WEBMAIL }}; rewrite /sso/static/(.*) /static/$1 permanent;
} }
{% endif %}
location ^~ /static { location ^~ /static {
include /etc/nginx/proxy.conf; include /etc/nginx/proxy.conf;
rewrite ^/static/(.*) /ui/static/$1 break; rewrite ^/static/(.*) /ui/static/$1 break;
proxy_pass http://$admin; proxy_pass http://$admin;
} }
{% endif %}
{% if WEB_WEBMAIL != '/' and WEBROOT_REDIRECT != 'none' %} {% if WEB_WEBMAIL != '/' and WEBROOT_REDIRECT != 'none' %}
location / { location / {
@ -216,10 +198,26 @@ http {
location @webmail_login { location @webmail_login {
return 302 /sso/login?next=ui.webmail; return 302 /sso/login?next=ui.webmail;
} }
location ^~ {{ WEB_WEBMAIL }}/sso/ui/logout {
include /etc/nginx/proxy.conf;
rewrite ^{{ WEB_WEBMAIL }}/sso/ui/logout$ /sso/logout break;
proxy_pass http://$admin;
}
location ^~ /ui/webmail {
include /etc/nginx/proxy.conf;
return 302 {{ WEB_WEBMAIL }};
}
{% else %} {% else %}
{% endif %} {% endif %}
{% if ADMIN == 'true' %} {% if ADMIN == 'true' %}
location ^~ /ui {
include /etc/nginx/proxy.conf;
rewrite ^/ui/(.*) {{ WEB_ADMIN }}/ui/$1 redirect;
}
location {{ WEB_ADMIN }} { location {{ WEB_ADMIN }} {
return 301 {{ WEB_ADMIN }}/ui; return 301 {{ WEB_ADMIN }}/ui;
} }

Loading…
Cancel
Save