cachethq / Docker

A Dockerized version of Cachet.
https://cachethq.io
BSD 3-Clause "New" or "Revised" License
415 stars 280 forks source link

problem with nginx proxy before docker container #374

Open RedJohn14 opened 4 years ago

RedJohn14 commented 4 years ago

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!

crimewaffle commented 8 months ago

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