Fixing SSL mixed content errors with external NGINX proxy via UNIX socket

Howdy,
I recently deployed a Discourse instance behind my pre-existing NGINX server using the “socketed” template. It works fine, except that I’m getting mixed content warnings originating from the web worker process requesting resources over HTTP. My server is configured to 301 all HTTP requests over to HTTPS, but apparently this is not pedantic enough to please Chrome’s validator, so I get broken images and a security warning that at least sounds scary to users.

This is the error Chrome is logging:

All I need to do is force the web worker to make the requests using https URLs, is there an easy way to do this?

I tried enabling the SSL template but that didn’t seem to have any effect on what the web worker was pulling, and Chrome still complained the same.

I’d prefer keep the socket-proxy configuration because the NGINX is going to be fronting this deployment regardless, and having all the SSL/frontend config in one place for all the apps running on this server is just easier to maintain.

2 Likes

There is a site setting force_https. You might set this env variable

DISCOURSE_FORCE_HTTPS=true
5 Likes

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