Discourse always generates links to itself with http: rather than https:

I have recently switched to having Discourse listen on a Unix socket and proxying through an nginx server on the underlying Linux system. Works great.

However, Discourse builds all of its internal links with http, so it’s mixed content warnings all over the place.

Is there a simple way to force this issue in app.yml? DISCOURSE_PROTOCOL would be great but I don’t think it exists.

I did try configuring nginx to pass a protocol header, but this doesn’t appear to make any difference:

proxy_set_header X-Forwarded-Proto "https";

Any thoughts? Thanks.

2 Likes

Make sure you’ve enabled the force_https site setting in Discourse.

6 Likes

Thanks, now I’m down to tracking down a few things I apparently overrode in the header… somehow… when this was set up… years ago. :cry: :laughing:

2 Likes

Figured that out too. Admin -> Customize -> Clicked on my existing “New Style” (this was what was not obvious) -> drilled down from there to desktop header.

2 Likes

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