Mixed content for icon using http on https setup

AI-generated summary

The user jirenius reports a mixed content issue in their Discourse setup where icons are served over HTTP despite the site using HTTPS, causing browser errors. They are using Nginx with SSL and have enabled ‘force HTTPS’ in settings, but the issue persists. Despite no visible HTTP references in settings, the problem is resolved after re-running the wizard and re-uploading all images, including the primary logo, square logo, browser icon, and large icon. jirenius notes the fix is unclear but effective.

Thanks for great software!

While I am serving Discourse over https, the icon and apple-icon are served from http:

<link rel="icon" type="image/png" href="http://forum.resgate.io/uploads/default/optimized/1X/0b59c13d8375cb2633f1fb9aa906299a1ba3e77f_2_32x32.png">
<link rel="apple-touch-icon" type="image/png" href="http://forum.resgate.io/uploads/default/optimized/1X/033a4835ac24c0d54a87dad0b22b2c4146ca0f40_2_180x180.png">

Giving the error in Chrome: Mixed Content: ...

My setup:

  • I use a standard theme. No modifications.
  • I use nginx which handles ssl with proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
  • nginx is configured with: proxy_set_header Host https;
  • My app.yml contains templates/web.socketed.template.yml as described this Meta Discourse HowTo
  • I have Settings - Security - force https enabled
  • I have rerun the /wizard, removed the favicon and reuploaded it again.
  • I have found no reference to http:// anywhere in the settings.

I’ve ready other similar posts, but those seems to all been solved with force https, but not in my case.

Thanks for help!

UPDATE:

I ran the /wizard again, this time uploading all images (not just the Browser Icon) again:

  • Primary Logo
  • Square Logo
  • Browser Icon
  • Large Icon

Then it started working. Not sure why, but it solved the issue.