From 528fc477699f9ba34bd24446c8955baacc11437d Mon Sep 17 00:00:00 2001 From: vinanrra Date: Fri, 24 Apr 2020 11:51:33 +0200 Subject: [PATCH 1/7] Create mailu subfolder This will need some disscusion, because i have edited the default docker-compose to make it works, but maybe those edit arent need it. --- mailu.subfolder.conf | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 mailu.subfolder.conf diff --git a/mailu.subfolder.conf b/mailu.subfolder.conf new file mode 100644 index 0000000..5f22bbf --- /dev/null +++ b/mailu.subfolder.conf @@ -0,0 +1,30 @@ +# This config have been tested with "TLS_FLAVOR=mail" + +location /admin{ + return 301 $scheme://$host/admin/; + proxy_redirect https://localhost https://DOMAIN.TDL; ## To avoid errors https://mailu.io/master/reverse.html +} +location ^~ /admin/ { + include /config/nginx/proxy.conf; + resolver 127.0.0.11 valid=30s; + set $upstream_app front; + set $upstream_port 80; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + proxy_redirect https://localhost https://DOMAIN.TDL; ## To avoid errors https://mailu.io/master/reverse.html + +} +location /webmail{ + return 301 $scheme://$host/webmail/; + proxy_redirect https://localhost https://DOMAIN.TDL; ## To avoid errors https://mailu.io/master/reverse.html +} +location ^~ /webmail/ { + include /config/nginx/proxy.conf; + resolver 127.0.0.11 valid=30s; + set $upstream_app front; + set $upstream_port 80; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + proxy_redirect https://localhost https://DOMAIN.TDL; ## To avoid errors https://mailu.io/master/reverse.html + +} From 8c5e95ea56d2adbf62dd1c9e50be6c43a5b42c16 Mon Sep 17 00:00:00 2001 From: vinanrra Date: Fri, 24 Apr 2020 12:00:14 +0200 Subject: [PATCH 2/7] Update mailu.subfolder.conf --- mailu.subfolder.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mailu.subfolder.conf b/mailu.subfolder.conf index 5f22bbf..1d97d71 100644 --- a/mailu.subfolder.conf +++ b/mailu.subfolder.conf @@ -1,4 +1,6 @@ # This config have been tested with "TLS_FLAVOR=mail" +# To avoid errors you must change in docker-compose ports: 80 and 443, more info: https://mailu.io/1.7/reverse.html +# Maybe the proxy_redirect arent need it, but it is working and are not harmful location /admin{ return 301 $scheme://$host/admin/; From 428f3cb7d11f95cc648431bdc5d5b40bfe4a14c8 Mon Sep 17 00:00:00 2001 From: vinanrra Date: Fri, 24 Apr 2020 18:16:08 +0200 Subject: [PATCH 3/7] Updated Modified to meet the others reverse proxies standards --- mailu.subfolder.conf | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/mailu.subfolder.conf b/mailu.subfolder.conf index 1d97d71..536112d 100644 --- a/mailu.subfolder.conf +++ b/mailu.subfolder.conf @@ -1,7 +1,49 @@ +# mailu does not require a base url setting, but the container needs to be named front + # This config have been tested with "TLS_FLAVOR=mail" # To avoid errors you must change in docker-compose ports: 80 and 443, more info: https://mailu.io/1.7/reverse.html -# Maybe the proxy_redirect arent need it, but it is working and are not harmful +location /admin{ + return 301 $scheme://$host/admin/; +} +location ^~ /admin/ { + # enable the next two lines for http auth + #auth_basic "Restricted"; + #auth_basic_user_file /config/nginx/.htpasswd; + + # enable the next two lines for ldap auth, also customize and enable ldap.conf in the default conf + #auth_request /auth; + #error_page 401 =200 /login; + + include /config/nginx/proxy.conf; + resolver 127.0.0.11 valid=30s; + set $upstream_app front; + set $upstream_port 80; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + +} + +location /webmail{ + return 301 $scheme://$host/webmail/; +} +location ^~ /webmail/ { + # enable the next two lines for http auth + #auth_basic "Restricted"; + #auth_basic_user_file /config/nginx/.htpasswd; + + # enable the next two lines for ldap auth, also customize and enable ldap.conf in the default conf + #auth_request /auth; + #error_page 401 =200 /login; + + include /config/nginx/proxy.conf; + resolver 127.0.0.11 valid=30s; + set $upstream_app front; + set $upstream_port 80; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + +} location /admin{ return 301 $scheme://$host/admin/; proxy_redirect https://localhost https://DOMAIN.TDL; ## To avoid errors https://mailu.io/master/reverse.html From ba392bba42fe9d97bd0276c9d059e34348fab6d3 Mon Sep 17 00:00:00 2001 From: vinanrra Date: Fri, 24 Apr 2020 18:40:12 +0200 Subject: [PATCH 4/7] Create mailu.subdomain.conf --- mailu.subdomain.conf | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 mailu.subdomain.conf diff --git a/mailu.subdomain.conf b/mailu.subdomain.conf new file mode 100644 index 0000000..a8a44de --- /dev/null +++ b/mailu.subdomain.conf @@ -0,0 +1,33 @@ +# make sure that your dns has a cname set for mailu and that your mailu front container is named front + +server { + listen 443 ssl; + listen [::]:443 ssl; + + server_name mailu.*; + + include /config/nginx/ssl.conf; + + client_max_body_size 0; + + # enable for ldap auth, fill in ldap details in ldap.conf + #include /config/nginx/ldap.conf; + + location / { + # enable the next two lines for http auth + #auth_basic "Restricted"; + #auth_basic_user_file /config/nginx/.htpasswd; + + # enable the next two lines for ldap auth + #auth_request /auth; + #error_page 401 =200 /login; + + include /config/nginx/proxy.conf; + resolver 127.0.0.11 valid=30s; + set $upstream_app front; + set $upstream_port 80; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + + } +} From f019d4bf4c28156924da8d94d9377a5c44a345ac Mon Sep 17 00:00:00 2001 From: vinanrra Date: Fri, 24 Apr 2020 20:09:39 +0200 Subject: [PATCH 5/7] Update mailu.subfolder.conf Ups forgot to remove duplicate things --- mailu.subfolder.conf | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/mailu.subfolder.conf b/mailu.subfolder.conf index 536112d..ae033e8 100644 --- a/mailu.subfolder.conf +++ b/mailu.subfolder.conf @@ -44,31 +44,3 @@ location ^~ /webmail/ { proxy_pass $upstream_proto://$upstream_app:$upstream_port; } -location /admin{ - return 301 $scheme://$host/admin/; - proxy_redirect https://localhost https://DOMAIN.TDL; ## To avoid errors https://mailu.io/master/reverse.html -} -location ^~ /admin/ { - include /config/nginx/proxy.conf; - resolver 127.0.0.11 valid=30s; - set $upstream_app front; - set $upstream_port 80; - set $upstream_proto http; - proxy_pass $upstream_proto://$upstream_app:$upstream_port; - proxy_redirect https://localhost https://DOMAIN.TDL; ## To avoid errors https://mailu.io/master/reverse.html - -} -location /webmail{ - return 301 $scheme://$host/webmail/; - proxy_redirect https://localhost https://DOMAIN.TDL; ## To avoid errors https://mailu.io/master/reverse.html -} -location ^~ /webmail/ { - include /config/nginx/proxy.conf; - resolver 127.0.0.11 valid=30s; - set $upstream_app front; - set $upstream_port 80; - set $upstream_proto http; - proxy_pass $upstream_proto://$upstream_app:$upstream_port; - proxy_redirect https://localhost https://DOMAIN.TDL; ## To avoid errors https://mailu.io/master/reverse.html - -} From f8b9cb371cb70ee5cfde40ec3adc4ef41e3596d4 Mon Sep 17 00:00:00 2001 From: vinanrra Date: Fri, 24 Apr 2020 20:11:08 +0200 Subject: [PATCH 6/7] Rename mailu.subfolder.conf to mailu.subfolder.conf.sample --- mailu.subfolder.conf => mailu.subfolder.conf.sample | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename mailu.subfolder.conf => mailu.subfolder.conf.sample (100%) diff --git a/mailu.subfolder.conf b/mailu.subfolder.conf.sample similarity index 100% rename from mailu.subfolder.conf rename to mailu.subfolder.conf.sample From 8d05f0bcc117b74d658f2f1324020066e6879ba6 Mon Sep 17 00:00:00 2001 From: vinanrra Date: Fri, 24 Apr 2020 20:11:20 +0200 Subject: [PATCH 7/7] Rename mailu.subdomain.conf to mailu.subdomain.conf.sample --- mailu.subdomain.conf => mailu.subdomain.conf.sample | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename mailu.subdomain.conf => mailu.subdomain.conf.sample (100%) diff --git a/mailu.subdomain.conf b/mailu.subdomain.conf.sample similarity index 100% rename from mailu.subdomain.conf rename to mailu.subdomain.conf.sample