Finishing touches. Introduce /static stub for handling all static files.

master
Dimitri Huisman 3 years ago
parent c1beee8fd7
commit 913a6304a7

@ -39,7 +39,6 @@ RUN set -eu \
&& apk del --no-cache build-dep
COPY --from=assets static ./mailu/ui/static
COPY --from=assets static ./mailu/sso/static
COPY mailu ./mailu
COPY migrations ./migrations
COPY start.py /start.py

@ -128,15 +128,6 @@ http {
include /overrides/*.conf;
# Actual logic
location ^~ {{ WEB_ADMIN }}/sso {
include /etc/nginx/proxy.conf;
rewrite ^{{ WEB_ADMIN }}/(.*) /$1 redirect;
}
location ^~ /ui/webmail {
include /etc/nginx/proxy.conf;
return 302 {{ WEB_WEBMAIL }};
}
{% if ADMIN == 'true' %}
location ^~ /ui {
include /etc/nginx/proxy.conf;
@ -149,14 +140,31 @@ http {
include /etc/nginx/proxy.conf;
proxy_pass http://$admin;
}
location ^~ /sso/static {
include /etc/nginx/proxy.conf;
rewrite /sso/static/(.*) /static/$1 permanent;
}
location ^~ /ui/language {
include /etc/nginx/proxy.conf;
proxy_set_header X-Forwarded-Prefix {{ WEB_ADMIN }};
proxy_pass http://$admin;
expires $expires;
}
location ^~ /ui/webmail {
include /etc/nginx/proxy.conf;
return 302 {{ WEB_WEBMAIL }};
}
{% endif %}
location ^~ /static {
include /etc/nginx/proxy.conf;
rewrite ^/static/(.*) /ui/static/$1 break;
proxy_pass http://$admin;
}
{% if WEB_WEBMAIL != '/' and WEBROOT_REDIRECT != 'none' %}
location / {
expires $expires;
@ -209,7 +217,7 @@ http {
return 301 {{ WEB_ADMIN }}/ui;
}
location ~ {{ WEB_ADMIN }}/(ui|static) {
location ~ {{ WEB_ADMIN }}/ui {
rewrite ^{{ WEB_ADMIN }}/(.*) /$1 break;
include /etc/nginx/proxy.conf;
proxy_set_header X-Forwarded-Prefix {{ WEB_ADMIN }};
@ -217,6 +225,11 @@ http {
expires $expires;
}
location ^~ {{ WEB_ADMIN }}/ui/static {
include /etc/nginx/proxy.conf;
rewrite {{ WEB_ADMIN }}/ui/static/(.*) /static/$1 permanent;
}
location {{ WEB_ADMIN }}/antispam {
rewrite ^{{ WEB_ADMIN }}/antispam/(.*) /$1 break;
auth_request /internal/auth/admin;
@ -224,6 +237,11 @@ http {
proxy_set_header X-Forwarded-For "";
proxy_pass http://$antispam;
}
location ^~ {{ WEB_ADMIN }}/sso {
include /etc/nginx/proxy.conf;
rewrite ^{{ WEB_ADMIN }}/(.*) /$1 redirect;
}
{% endif %}
{% if WEBDAV != 'none' %}

@ -2,4 +2,5 @@ Improved the SSO page.
- Now shows the login target.
- Added toggle to choose login target.
- Made SSO page available separately. SSO page can now be used without Admin.
- Introduced stub /static which is used by all sites for accessing static files.

Loading…
Cancel
Save