Mailu reverse proxy with Linuxserver/Letsencrypt

Im using this image: linuxserver/letsencrypt/

And im trying to create a mailu.subfolder.conf or even better a mailu.subdomain.conf, but first i am trying to do it with a subfolder, because of the wiki https://mailu.io/1.7/reverse.html

Now my problem, i have 0 idea of how to create a reverse proxy and the wiki its confusing for me, because i have tried almost every issue open or close here talking about reverse proxy and i have nothing only this page showing:

imagen

I would like to get help and create a mailu.subfolder.conf and add it to https://github.com/linuxserver/reverse-proxy-confs to avoid getting the same errors.

i have tried too to edit a pre-configured reverse-proxy i took as example adminer:

# adminer does not require a base url setting, but the container needs to be named adminer

location /adminer {
    return 301 $scheme://$host/adminer/;
}
location ^~ /adminer/ {
    # 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 adminer;
    set $upstream_port 8080;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

And did this (i have tried first to get working atleast /admin and them make works /webmail, but i couldnt :cry: ):


# adminer does not require a base url setting, but the container needs to be named adminer

location /admin{
    return 301 $scheme://$host/admin/;
}
location ^~ /admin/ {
    include /config/nginx/proxy.conf;
    resolver 127.0.0.11 valid=30s;
    set $upstream_app front;
    set $upstream_port 8080;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port/admin;

}

Got same error as above

And i dont know what to test more, because i have trying this 4 days, if someone could help me would be amazing, because i dont want to rent another VPS to only host Mailu.

I creating the files at:

Proxy-confs folder:
/nginx/proxy-confs

#Replace front with your service name

location /admin{
return 301 $scheme://$host/admin/;
}
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;

}
location /webmail{
return 301 $scheme://$host/webmail/;
}
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;

}

Now im facing this error:

2020/04/23 15:51:36 [info] 11#11: *55 upstream sent invalid response: “NO [AUTHENTICATIONFAILED] Authentication failed.” while reading response from upstream, client: 172.18.0.18, server: 0.0.0.0:10143, login: “admin@XXXXXXXXXXX.XX”, upstream: 172.18.0.15:143

With this conf, i CANT access to webmail, but i can access to admin panel:

location /admin{
    return 301 $scheme://$host/admin/;
    proxy_redirect https://localhost https://raventech.es;
}
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://raventech.es; ## Dunno if need it

}
location /webmail{
    return 301 $scheme://$host/webmail/;
    proxy_redirect https://localhost https://raventech.es;
}
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://raventech.es; ## Dunno if need it

}

Github: https://github.com/Mailu/Mailu/issues/1459