You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quasar docs for SPA mode provide an example of how to configure nginx to serve a Quasar app
SSR mode doesn't really need it, as everything is server side generated, so nginx only needs to redirect everything to Quasar SSR Node process
SSG on the other side need a slightly different configuration, or nginx will answer with a 301 status whenever an URL without a pending slash is found
What we found to work for us was to add $uri/index.html explicitly and redirect to the 404 error page if nothing is found
location / {
try_files $uri $uri/index.html $uri/ =404;
}
# Not sure if this is actually needed, or if nginx has some kind of smart default for this, doesn't seem so
# See http://nginx.org/en/docs/http/ngx_http_core_module.html#error_page
error_page /404.html;
The text was updated successfully, but these errors were encountered:
I should definitely document how to setup a static server for SSG hosting. Thanks you for pointing this out to me.
After some good reading on the subject, I cannot recommend this configuration as it may hurt SEO due to duplicate content.
My advice is to stick to a consistent choice of whether or not to use a trailing slash. Then configure your server to do 301 redirects to add/remove the trailing slash.
Setting the Vue router strict option to true could help in this scenario. But then I would have to make sure that the extension generate the correct routes (with or without trailing slash).
I could possibly add an option to the extension for this.
What do you think ?
EDIT: I highly recommend you to read SvelteKit configuration about trailing slash. I think it point to the right direction.
Interesting, I didn't really put much thoughts on URL duplication as Vue-router goes without trailing slash by default AFAIK, so people would explicitly need to add that trailing slash to cause that problem, but I understand your point
I'll take a look to the resources you provided, which seem really interesting, and adapt our configuration accordingly, thanks
About the "strict" option into Vue-router, I'm not really sure how much that's used and if it's worth making it configurable
This seems more like one of those things where an opinionated choice is fine, until there's a valid use case which requires it to be configurable
Quasar docs for SPA mode provide an example of how to configure nginx to serve a Quasar app
SSR mode doesn't really need it, as everything is server side generated, so nginx only needs to redirect everything to Quasar SSR Node process
SSG on the other side need a slightly different configuration, or nginx will answer with a 301 status whenever an URL without a pending slash is found
What we found to work for us was to add
$uri/index.html
explicitly and redirect to the 404 error page if nothing is foundThe text was updated successfully, but these errors were encountered: