Question

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

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.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Accepted Answer

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

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

KDSys,

good idea, thank you much