webpack-dev-server proxy dosen't work
See original GitHub issueI want to proxy /v1/** to http://myserver.com, and here is my devServer configration,
devServer: {
historyApiFallBack: true,
// progress: true,
hot: true,
inline: true,
// https: true,
// port: 8081,
contentBase: path.resolve(__dirname,'public'),
proxy: {
'/v1/**': {
target: 'http://api.in.uprintf.com/',
secure: false
// changeOrigin: true
}
}
},
but it results in 404 not found error, and here is the response,
Request URL:http://localhost:8080/v1/address/school?keyword=scut&_=1460968888999
Request Method:GET
Status Code:404 Not Found
Remote Address:127.0.0.1:8080
Response Headers
view source
connection:close
content-encoding:gzip
content-type:text/html
date:Mon, 18 Apr 2016 08:41:34 GMT
server:nginx/1.4.6 (Ubuntu)
transfer-encoding:chunked
X-Powered-By:Express
It seems to proxy to my ubuntu nginx server, since i use mac os locally, but i don’t use express in my remote server.
Issue Analytics
- State:
- Created 7 years ago
- Comments:39 (4 by maintainers)
Top Results From Across the Web
devServer proxy not working · Issue #793 - GitHub
devServer proxy doesn't proxy. If the current behavior is a bug, please provide the steps to reproduce. Client server running at localhost:8080 ...
Read more >Webpack 5 Dev Server proxy seems to be ignored
After upgrading to webpack 5, everything seems fine except the dev server proxy. Its like whatever values I put in there are just...
Read more >DevServer - webpack
DevServer. webpack-dev-server can be used to quickly develop an application. See the development guide to get started. This page describes the options that ......
Read more >webpack-dev-server - npm
--no-history-api-fallback Disallows to proxy requests through a specified index page. --host <value> Allows to specify a hostname to use. --hot ...
Read more >Development Server - SurviveJS
webpack-dev-server (WDS) is the officially maintained development server running ... but it's worth trying out if the file watching doesn't work for you....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

when i set proxy option:
changeOrigin: true, it works. From the node-http-proxy’s document, it says,‘changeOrigin: true/false, Default: false - changes the origin of the host header to the target URL’. Does the changeOrigin option depend on the remote backend server framework?
@pgangwani Try this. Was able to get this to run.