-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Proxy not working #424
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
Comments
Yep, I confirm that proxy is not working. |
there is no See options here: https://www.npmjs.com/package/http-proxy-middleware |
I am also experiencing this issue and am not using any kind of rewrites, just a simple: proxy: {
'/api/*': {
target: 'http://localhost:4001'
}
} Similarly to @chrismcv, I get a 404 for Edit: express in debug mode reports this progress of events when one of the endpoints is hit:
... but any logging within the express route does not happen. |
For those committed to Webpack 2 beta but need request proxying with your HMR, if you install [email protected] and swap in 2.0.0 beta's |
http how to proxy https? |
As @sokra already mentioned the It would be cool, @sokra, if this could be mentioned in the docs somewhere. 😊 |
Hi, I'm getting a 502 (Bad Gateway) error while using webpack 2 beta and webpack-dev-server with HMR while trying to proxy. |
Was caused by a Rails problem, not webpack. Sorry. |
I had an error with ajax call too : when I made request to my backend, there was a 404 error and the proxy did not seem to work. In fact, it was because the matched pattern is used in the redirection : you can delete it that way : proxy: {
'/api/**': {
target: 'http://localhost:8080/',
rewrite: function(req) {
req.url = req.url.replace(/^\/api/, '');
},
changeOrigin: true
}
} So, that way my calls to http://localhost:3000/api/*\* are redirected to http://localhost:8080/, and not http://localhost:8080/api |
@chrismcv, were you able to solve your issues with the answers provided above? |
For me before angular2 rc.5 this worked:
Now I got also 404 errors for all of my services.
|
If your proxy still doesn't work, but worked in old versions of 1.x, try to add |
Just incase anyone else is running into this issue - the PHP standalone server also requires "[::1]" instead of localhost:
|
above solution works on OS X, hitting java server running on 8081, from webpack on 9000. |
We got 404 from azure api servers, and we solved it by adding
|
@karl-gustav just spent 3 hours debugging the 404 error. Your comment saved me potentially more hours. Researching back at the http-proxy-middleware docs, I found the tip I still don't fully understand the reason for this. Would appreciate any help. |
@tindn I’m afraid we won’t be much help here, we just tried stuff until it worked :-( |
@karl-gustav Good, I do so and it works well now. |
I have same issue. All above advice does not work |
Ive been trying to add it to an Angular Cli app, and it doesn't work either, no solutions thus far |
I tried all options above in my vuejs app, but none of them seem to work.
and writing POST request in one of the components as:
But, this seems not to work, as long as I'm getting the error : Anybody can help me to figure out what's wrong here, please? |
@NodiraIbrogimova this worked for me:
|
Ran into this issue after upgrading nx and angular to their latest versions, something changed and the asterisk is no longer a wildcard but a literal, after removing the asterisks it worked again |
Hi,
I'm using the following configuration, and running
webpack-dev-server --content-base public
All requests e.g.
/api/user/current
have a 404 response, and myconsole.log
never fires. Is there some other part of the config that I'd need to change?Thanks,
Chris
The text was updated successfully, but these errors were encountered: