That’s because the server doesn’t know how to handle requests to mymail.mydomain.com. It is up to the server, not SWAG to know that. As an example, my SWAG instance hosts 31 different services, a mixture of local containers and remote servers. The example I gave in my previous post is my Home Assistant server. SWAG doesn’t know what Home Assistant is. All it knows is that when it receives a request for house.my.domain it has to forward it to the server at 10. 244. 101. 178, port 8123 using http.
I am trying to find that “something else” (to understand how things work).
I explained this really badly in my first response. I’ll try again.
proxy_pass only cares about server.domain.com and nethserver.internaldomain.com. Anything else is not relevant to SWAG. Let’s see if I can explain it better with some examples:
Simple
server = www.domain.com
proxypass = http://192.168.1.50/
I request www.domain.com
The server at 192.168.1.50 serves www.domain.com
Next step
server = www.domain.com
proxypass = http://192.168.1.50/
I request www.domain.com/folder
The server at 192.168.1.50 serves www.domain.com/folder
What you did
server = www.domain.com
proxypass = http://192.168.1.50/webtop
I request www.domain.com/webtop
The server at 192.168.1.50 (tries to) serve www.domain.com/webtopwebtop
Given a proxy directive of (server)/(other_stuff) Nginx doesn’t care about (other_stuff) only the host - so it will tack on (other_stuff) to the end of the URL. If you’ve already requested (other_stuff) and your proxy says that, you get double (other_stuff).