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

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?


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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.

Regards, KDSys