I am using Magento 2.4.4 with Nginx and Varnish
out of the blue all css/js stopped loading on my local server.
I checked the log and nothing is there.
I checked the permission and it should be all fine.
Clear all cache
The only error I get is on safari:
Failed to load resource: Could not connect to the server. _________ .css
The question is why does .css/.js doesn't connect to the server???
Any help is welcome.
Solved! Go to Solution.
Finally solved it... Here is how I did it:
1. Stopped Varnish and only work with Nginx
2. Reinstall initial config of Nginx
3. Restart my php-fpm process
Thanks
Hello @cmoi40
Please set permission by using below commands:
find . -type f -exec chmod 644 {} \; // 644 permission for files find . -type d -exec chmod 755 {} \; // 755 permission for directory find ./var -type d -exec chmod 777 {} \; // 777 permission for var folder find ./pub/media -type d -exec chmod 777 {} \; find ./pub/static -type d -exec chmod 777 {} \; chmod 777 ./app/etc chmod 644 ./app/etc/*.xml
and run below commands:
php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f php bin/magento cache:flush
Hi Bhanu,
Thanks for the help. I followed the instructions and had no errors but somehow the css/js still doesn't show up and I get the same error on safari dev.
I should also mention I am not using root but another user and using sudo.
Any other suggestions?
Thanks
OK...getting closer to know what is going on. This seems to be a server issue since it redirects my css/js and images to a different port! plus each port is different.
example:
GET http://192.168.1.184/media/myshop/Demos/sp/a2logo.png net::ERR_CONNECTION_REFUSED
192.168.1.184/:443 GET http://192.168.1.184/media/myshop/Demos/sp/slide-headphones-bg.jpg net::ERR_CONNECTION_REFUSED
192.168.1.184/:468 GET http://192.168.1.184/media/myshop/Demos/sp/home-sp-slide-02.jpg net::ERR_CONNECTION_REFUSED
192.168.1.184/:14 GET http://192.168.1.184/static/version1662490507/frontend/Gurutoy/myshop/en_US/css/styles-l.css net::ERR_CONNECTION_REFUSED
As you can see various port are assigned to css/js/images... therefore this must be an issue with Nginx/Varnish.