1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-06-02 23:17:26 +02:00
2084: Fix #2078 (login to webmail did not work when WEB_WEBMAIL=/ was set) r=mergify[bot] a=Diman0

## What type of PR?

bug-fix

## What does this PR do?
It fixes #2078. Login from SSO page to webmail did not work if WEB_WEBMAIL=/ was set in mailu.env.

I tested that it works with
- WEB_WEBMAIL=/webmail
- WEB_WEBMAIL=/

### Related issue(s)
- closes #2078 

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [x] n/a In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Dimitri Huisman <diman@huisman.xyz>
Co-authored-by: Florent Daigniere <nextgens@users.noreply.github.com>
This commit is contained in:
bors[bot] 2021-12-15 09:54:37 +00:00 committed by GitHub
commit e7f77875e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -135,7 +135,7 @@ http {
# Actual logic
{% if ADMIN == 'true' or WEBMAIL != 'none' %}
location ~ ^/(sso|static) {
location ~ ^/(sso|static)/ {
include /etc/nginx/proxy.conf;
proxy_pass http://$admin;
}
@ -165,7 +165,11 @@ http {
proxy_pass http://$webmail;
}
{% if WEB_WEBMAIL == '/' %}
location /sso.php {
{% else %}
location {{ WEB_WEBMAIL }}/sso.php {
{% endif %}
{% if WEB_WEBMAIL != '/' %}
rewrite ^({{ WEB_WEBMAIL }})$ $1/ permanent;
rewrite ^{{ WEB_WEBMAIL }}/(.*) /$1 break;

View File

@ -0,0 +1 @@
SSO login page to webmail did not work if WEB_WEBMAIL=/ was set.