caprover / nginx-reverse-proxy

A very simple reverse proxy using nginx and Docker
19 stars 41 forks source link

Redirect to upstream URL #4

Closed ghost closed 3 years ago

ghost commented 3 years ago

I use CapRover with mailcow through docker-compose. I use http://nginx-mailcow:8080 as my upstream URL and 80 as my container port. This works but on SoGo if I click on login it redirects me to nginx-mailcow:8080 and I don't understand why. Replacing that with my domain works just fine which means I get logged in and can use my email. I came originally from jwilder nginx reverse proxy and I didn't had this issue with it.

githubsaturn commented 3 years ago

It's duplicate of this issue: https://github.com/caprover/caprover/issues/948#issuecomment-749883518

As I mentioned there - it's not related to the reverse proxy. The proxy layer only re-routes the request to the upstream service. It does not change the links on the webpages. See here: https://github.com/caprover/nginx-reverse-proxy/blob/master/default.conf#L12

ghost commented 3 years ago

Well it did work out of the box with jwilder nginx proxy why isn't it with this reverse proxy the same?

githubsaturn commented 3 years ago

@PortStone - that's a question for Mailcow folks. My "guess" is that you have to set VIRTUAL_HOST and VIRTUAL_PORT env vars on mailcow installation and that's what they use in order to construct login links.

You can see relevant issues on mailcow forum: https://github.com/mailcow/mailcow-dockerized/issues/570