NetCoreTemplates/vue-nuxt

I do not work in iis

itoop2019 opened this issue · 4 comments

I do according to the README.md tool. Dev-environment - works. I do npm run publish and deploy to IIS, but the application seems to start up, but the circle is spinning all the time and nothing happens
MyApp-Nuxt

mythz commented

Please provide as much info you can about the error.

e.g. Does Chrome Web Inspector show any error network requests? What is the full Request/Response Headers of requests that have failed.

Does it have any JavaScript errors? etc.

mythz commented

Also make sure that your published App works locally, i.e. in your publish folder:

$ cd bin\Release\netcoreapp2.1\publish

Run your Host project dll, e.g:

$ dotnet YourProjectName.dll

Sorry.
I think what the problem is.

If you create a non-nested application in IIS, then everything works fine.
But I in IIS created an application internal (or nested, in pic)

IISnuxtNested

So, if you do the nested, then the web api works,

IISnuxtNestedAPI

but the front - does not work

IISnuxtNestedPath

mythz commented

The nested path is breaking paths in Nuxt's generated pages which expects it to be available from the / path, e.g. /wwwroot/_nuxt should be available from /_nuxt which Nuxt hard codes in all its generated pages.

The way to control how Nuxt generates its pages is via generate configuration in nuxt.config.js, the documentation for Nuxt's generate configuration is here but there doesn't seem to be any configuration to control the base path for its generated resources so it doesn't look like it supports not hosting its generated resources from the / root path.

If you wanted to host it from a virtual path in IIS you're going to need to configure a reverse proxy or rewrite rules in front of your App that rewrites paths into what Nuxt expects.