Nginx Reverse Proxy Node css not loading

I have a node app running with reverse proxy on nginx. SSL is not enabled as this is a test app which I’m accessing using the public IP. The problem is that the app is loaded with http and the HTML loads correctly, but the CSS and JS files are not loading. After checking the network tab, all the resource files are trying to load with HTTPS which results in ERR_CONNECTION_TIME_OUT after a while. When I try to access the CSS files directly with HTTPS changed to HTTP, the file loads up. I have searched for a solution but could not find a solution that works.

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.

Hi there,

This usually happens when you try to load your static files via HTTPS directly but do not have SSL installed.

It is not really an Nginx configuration problem. In your application, you need to specify that the URL that the static files are loaded from and make sure that it is not using HTTPS.

Alternatively, you could get a free domain name and install an SSL certificate so that your dev site is also secure:

How to get a free domain name

Regards, Bobby