cachethq / cachet

🚦 The open-source status page system.
https://cachethq.io
MIT License
14.01k stars 1.56k forks source link

Cachet redirect to localhost #4222

Closed webjoel closed 3 years ago

webjoel commented 3 years ago

I'm trying to upload the cache via docker compose and using a reverse proxy to enable HTTPS.

However when accessing the URL the page opens unconfigured and in the error console shows the errors below:

Mixed Content: The page at 'https://status.xxxx.com/setup' was loaded over HTTPS, but requested an insecure element 'http://localhost:8000/img/cachet-logo.svg'. This request was automatically upgraded to HTTPS, For more information see https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html
setup:26 GET http://localhost:8000/dist/css/dashboard/dashboard.css?id=b6a9327dd3b9b7c7ed2d net::ERR_CONNECTION_REFUSED
setup:34 GET http://localhost:8000/dist/js/manifest.js?id=40dcfff9d09d402daf38 net::ERR_CONNECTION_REFUSED

My configuration in nginx reverse proxy:

# Cachet
#
server {
        listen 443;
        ssl on;
        ssl_certificate /opt/xxxx/certs/fullchain.crt;
        ssl_certificate_key /opt/xxxx/certs/private.key;
        server_name status.xxxx.com.br;

        location / {
                proxy_pass http://localhost:8000;
        }
}

My docker-compose:

version: "3.3"
services:
  cachet:
    image: cachethq/docker
    restart: always
    ports:
      - 8000:8000
    environment:
      - DB_DRIVER=pgsql
      - DB_HOST=172.17.0.1
      - DB_PORT=5432
      - DB_DATABASE=cachet
      - DB_USERNAME=postgres
      - DB_PASSWORD=postgres
      - DB_PREFIX=chq_
      - APP_KEY=base64:jksfjakldJKLFJKSGJKLDFJKLjfkdjskjgksdFJKFJKFJKLADS=
      - APP_LOG=errorlog
      - APP_ENV=production
      - APP_DEBUG=false
      - DEBUG=false
welcome[bot] commented 3 years ago

:wave: Thank you for opening your first issue. I'm just an automated bot that's here to help you get the information you need quicker, so please ignore this message if it doesn't apply to your issue. If you're looking for support, you should try the Slack group by registering your email address at https://cachethq-slack.herokuapp.com. Alternatively, email support@alt-three.com for our Professional support service (please note, this a paid service.) If you're issue is with documentation, you can suggest edits by clicking the Suggest Edits link on any page, or open an issue at https://github.com/CachetHQ/Docs

webjoel commented 3 years ago

Solved:

Add in conf nginx:

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;