Docker icon indicating copy to clipboard operation
Docker copied to clipboard

problem with nginx proxy before docker container

Open RedJohn14 opened this issue 4 years ago • 1 comments

Hello,

I have installed cachet via docker, everything works fine very good job ;-)

BUT I have change the port section like this:

ports:
      - 8080:8000

BUT if I create some nginx server on the docker host like this:

upstream ssp {
    server 127.0.0.1:8080;
}

location / {
                proxy_pass          http://ssp;
                proxy_http_version  1.1;
                proxy_set_header    Host $http_host;
                proxy_set_header    X-Real-IP $remote_addr;
                proxy_set_header    Upgrade $http_upgrade;
                proxy_set_header    Connection $http_connection;
                proxy_set_header    Origin  http://$host;
                proxy_set_header    X-Forwarded-Ssl off;
                proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header    X-Forwarded-Port    80;
        }

My nginx server make HTTP to HTTPS redirect and make the SSL connection. Unfortunately cachet website look not so good the content could not be load correctly. Any idea what I can do now? Is cachet docker not ready for proxy?

Regards!

RedJohn14 avatar Apr 16 '20 20:04 RedJohn14

Still an issue? If you run nginx inside a container you need to change the server ip to the hostname of the cachet container. 127.0.0.1 is the containers localhost and not the one from the hypervisor/host

crimewaffle avatar Dec 26 '23 08:12 crimewaffle