我的应用程序出现了WDS断开连接错误。
webpack.config.js上的
entry: {
App: [
'webpack-dev-server/client?https://127.0.0.0:3001',
'webpack/hot/only-dev-server',
'./src/index.js'
]
},
devServer: {
inline: true,
port: 3001,
historyApiFallback: true,
contentBase: __dirname + '/public/',
disableHostCheck: true,
},
在package.json上
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack-dev-server --hot --host 0.0.0.0"
},
我在nginx上使用proxypass,请求被发送到
https://aaa.test.com:7777/sockjs-node/info?t=1525090493047
如果删除
之类的端口号https://aaa.test.com/sockjs-node/info?t=1525090493047
我可以看到一些文字,但是有了端口号,它会转到错误页面。
关于nginx设置,
location / {
proxy_pass http://127.0.0.1:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
我做错了吗?