Question

how do i know if nginx has correct configuration file? To fix and avoid mixed content error

Posted January 20, 2020 787 views
Nginx

Hi there,

I think I have configure the SSL and nginx correcty by using the guides.
https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04 https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04

However, the Http request scheme and http scheme is not set to htpps in the system information provided in the admin area.

As a result, all the images uploaded to the site got mixed content error. the images are actually available from an https URL when I change the http to https in the browser.

Mixed Content: The page at ’https://example.com/’ was loaded over HTTPS, but requested an insecure image ’http://example.com/content/images/thumbs/5e229c1241809003f1abbd1c.png’. This content should also be served over HTTPS.

I’m guessing the nginx server has some configuration file messing this up somewhere. how do I figure it out and fix this? In the appsetting.json file, I set “UseForwardedHeaders”: true but it didn’t fix the prob.

I have tried to solve this issues for about 4 days now. Appreciate if you can show me how to fix this.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hi @nurbliss25,

In my experience mixed content comes from the website links it’s using and not the Nginx configuration.

Depending on the CMS/Framework you are using the links for your images,css files, javascript files are stored in different places. If you are indeed using a CMS or a Framework of somesorts there should be a lot of articles about dealing with mixed content. If you however have a custom built application, I’ll suggest contacting the developer of the app.

Regards
KDSys

KDSys,

good idea, thank you much

Submit an Answer