Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production mode refresh causing 404 #511

Closed
jakubsikora opened this issue Feb 11, 2017 · 9 comments
Closed

Production mode refresh causing 404 #511

jakubsikora opened this issue Feb 11, 2017 · 9 comments

Comments

@jakubsikora
Copy link

I have a simple router setup

const router = new Router({
  mode: 'history',
  scrollBehavior: () => ({ y: 0 }),
  routes: [
    {
      path: '/',
      name: 'index',
      redirect: '/foo',
    },
    {
      path: '/foo',
      name: 'foo',
      component: Foo,
    },
  ],
});

In dev mode is all working fine. When i run npm run build and generate static files in the dist folder and then serv it let say using npm http-server everytime I refresh from e.g. localhost:8080/foo I'm getting 404.
I noticed that issue when I was trying to config gh-pages which base url is username.github.io/repo_name/.

Is there something I didn't setup properly?

@kazupon
Copy link
Contributor

kazupon commented Feb 12, 2017

This issue is not webpack template.
I guess that this issue is server setting.

See the vie-router docs
https://router.vuejs.org/en/essentials/history-mode.html

@kazupon kazupon closed this as completed Feb 12, 2017
@alziqziq
Copy link

why its not working for me? @kazupon

@ghost
Copy link

ghost commented Oct 17, 2017

@jakubsikora Did you ever figure this out? I'm running into the same issue using V2 + Webpack2 + NginX...

@jakubsikora
Copy link
Author

@JeremyGranger I moved it to my DO server and used pm2 + reverse proxy on nginx following https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04 and its working fine.

@ghost
Copy link

ghost commented Oct 19, 2017 via email

@HACHIMIam
Copy link

i have the same issue when i try to serve the index file with live-server

@Heunsig
Copy link

Heunsig commented Nov 21, 2017

@kazupon Thanks you :)

@mickaelbaron
Copy link

Hi,

I had the same issue. I followed this link: https://gist.github.com/szarapka/05ba804dfd1c10ad47bf

Mickael

@luis-abeno
Copy link

@kazupon Thanks =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants