Mixed content warnings running Discourse with Caddy

1. The problem I’m having:

I’m running Discourse in multisite with Caddy, following the very simple setup in examples/discourse at master · caddyserver/examples · GitHub. I’m getting Mixed content errors and warnings in the browser console for site assets like the logos and favicons.

2. Error messages and/or full log output:

3. Caddy version:

2.6.2

4. How I installed and ran Caddy:

a. System environment:

Intsalled with official installation method for Ubuntu 24.04.2 LTS.

b. Command:

systemctl start caddy

c. Service/unit/compose file:

d. My complete Caddy config:

tests-passed.kostka.studio {
reverse_proxy localhost:8080
}
pinboard.kostka.studio {
reverse_proxy localhost:8080
}
kiosk.kostka.studio {
reverse_proxy localhost:8080
}
transit.kostka.studio {
reverse_proxy localhost:8080
}

5. Links to relevant resources:

This is for a staging server, showcasing Discourse themes. I’m not planing to run any of this in production as I don’t understand much about server admin. But it would be nice if I could solve the mixed content issue for the staging instances.

This isn’t a Caddy issue - the problem is that your HTML has hardcoded http:// URLs.

1 Like

Thank you, @timelordx. Yes, it’s not a Caddy issue as such. I’m posting here because it could still be a general issue when using Caddy as reverse proxy for Discourse? In that case it would be helpful not only for me, but also for updating some of the knowledge topics here and on the Discourse community.

That’s a 7-year-old configuration example from a repo that’s been archived for 5 years now.

I’d recommend searching for DISCOURSE_FORCE_HTTPS and “force https” on the Discourse forum - you’ll find more up-to-date info there. Keep in mind, the Caddy documentation can’t possibly cover every web application out there.

Thank you, that already did the trick :slight_smile:

# FORCE SSL 
DISCOURSE_FORCE_HTTPS: true

Yes, but it’s also a popular topic that got responses until recently on the Discourse community, including references to that 7-yr old configuration example:

So I think it’s quite helpful to keep it up-to-date. Will post an update there and here for reference later.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.