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

config.devServer.proxy doesn't proxy, shows NotFound.vue #1550

Open
1 task done
THAlpha opened this issue Apr 18, 2019 · 5 comments
Open
1 task done

config.devServer.proxy doesn't proxy, shows NotFound.vue #1550

THAlpha opened this issue Apr 18, 2019 · 5 comments

Comments

@THAlpha
Copy link

THAlpha commented Apr 18, 2019

  • I confirm that this is an issue rather than a question.

Bug report

Version Tried in 0.14.11 and 1.0.0-alpha.47

Steps to reproduce

  • Start a new vuepress project
  • Create a .vuepress/config.js file with below config:
module.exports = {
  configureWebpack: (config, isServer) => {
    config.devServer = {
      proxy: {
        '^/auth': {
          target: 'http://localhost:7070',
          ws: true,
          changeOrigin: true
        }
      }
    };
  }
};
  • Run Vuepress dev (assuming port 8080)
  • Navigate to http://localhost:8080/auth/{anything}

What is expected?

Should serve the contents of http://localhost:7070/auth/{anything} on port 8080

What is actually happening?

Displaying 404 page (NotFound.vue) within vuepress + vue router

Other relevant information

  • Your OS: macOS 10.13.6
  • Node.js version: 8.11.3
  • Browser version: Chrome / v73
  • Is this a global or local install? local
  • Which package manager did you use for the install? npm and yarn (tried both)
  • Does this issue occur when all plugins are disabled? yes
@THAlpha
Copy link
Author

THAlpha commented Apr 18, 2019

I have created a sample repo that demonstrates this issue:

https://github.com/THAlpha/vuepress-proxy-test

@coder-xiaotian
Copy link

I encountered this problem too! I don't know how to fix it.

@coder-xiaotian
Copy link

coder-xiaotian commented May 25, 2019

I have solved the problem! I update the version of vuepress to 1.0.0-alpha.48 and then figure it out. I find the solution in this Issue #1195.

config.js:
image

@my9074
Copy link

my9074 commented Jun 14, 2019

@775146061 I update vuepress to 1.0.0-rc.1. And using your above configuration,proxy the ajax, but still does not take effect. At 404

config.js:

image

image

@coder-xiaotian
Copy link

@my9074 我上传了demo https://github.com/775146061/vuepressProxyDemo,我觉得可能是你哪儿配置错了,也可能是1.0.0-rc.1这个版本的问题,因为我试了一下用这个版本返回的http状态码是304,然后我升级到1.0.1就好了

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

3 participants