Question

Nginx Reverse Proxy Node css not loading

Posted September 14, 2021 87 views
NginxNode.js

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 ERRCONNECTIONTIME_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.

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.

×
Submit an Answer
1 answer

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