Site have http request error when routed behind Nginx proxy

Magento site content does not load properly when routed behind an Nginx proxy. In the browser console I see a lot of messages for http requests for stylesheets.

For example:

Mixed Content: The page at ‘‘ was loaded over HTTPS, but requested an insecure stylesheet ‘‘. This request has been blocked; the content must be served over HTTPS.


Mixed Content: The page at ‘‘ was loaded over a secure connection, but contains a form that targets an insecure endpoint ‘‘. This endpoint should be made available over a secure connection.

However, if I bypass Nginx and route directly to the backend server, the site loads fine.

I am assuming something in Magento is making it use http instead of https for some requests.

How should I go about fixing this?

submitted by /u/davidbarman
[link] [comments]