Nuxt/Vue no assets/JS, Nginx configs necessary?

Posted March 10, 2020 3.6k views

I deployed my Nuxt app and Node app and they both run and can communicate. But I face the issue that my Nuxt app (SSR) does not load the assets from webpack even though they were build successfully. I checked the dist folder and they are all inside.

Do I have to configure Nginx to make SSR-apps serve assets or event javascript?

Does anybody have experience in deploying a server-side rendered app and whether there are some traps?


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 @Effection,

This error might as well be related to both your WebPack and your Nginx configuration vhost file.

Usually, Nginx does server assets such as css,js without a problem so the problem is coming either from the vhost itself or from WebPack.

For Nginx, please make sure everything is in the server block for the domain and the location is the correct one. Additionally, if you have added somesort of caching whether it’s browser leverage caching or expiring headers, basically anything of any sort, make sure it’s properly added to the configuration file.