Static GitHub Issues

[1352] Javascript doesn't work when put behind nginx with subdirectory

prev: [v1.0.0-rc4] axios cannot use Vue.prototype.$axios [axios v0.16.2]
next: Server Side Rendering for components called from layouts

Hello.

So basically, I have a nuxt application that is put behind nginx. The problem is that it is accessable through subdirectory (http://127.0.0.1/admin/ in my case). However, I see nuxt loading these scripts:

  • /_nuxt/manifest.612c946d31d19ad5d679.js
  • /_nuxt/vendor.bundle.68b421f11efb0ddd8251.js
  • /_nuxt/app.js

They do not exist, because whole application is accessable only through subdirectory.

My nginx configuration looks like this:

location ~* /admin {
    proxy_pass http://127.0.0.1:3000;
}

Is there a solution for this right now or it has to be implemented? If it has to be implemented, please give me some hints and I may do it myself :)

Thanks!

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1199">#c1199</a>)</em></sub></div>