玉器哪家网站做的好,网址缩短链接,教育类网页设计,济宁市建设工程招投标网站内网穿透 vue 返回 invalid host header
2019年03月17日 16:05:29 renzhehongyi 阅读数#xff1a;1926收起
个人分类#xff1a; 互联网Vue
问题#xff1a;使用花生壳内网穿透只返回304#xff0c;invalid host header
原因#xff1a;新版的webpack-dev-server出于…内网穿透 vue 返回 invalid host header
2019年03月17日 16:05:29 renzhehongyi 阅读数1926收起
个人分类 互联网Vue
问题使用花生壳内网穿透只返回304invalid host header
原因新版的webpack-dev-server出于安全考虑默认检查hostname如果hostname不是配置内的将中断访问。
解决webpack.dev.conf.js添加配置 disableHostCheck: true, devServer: { clientLogLevel: warning, historyApiFallback: { rewrites: [ { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, index.html) }, ], }, hot: true, contentBase: false, // since we use CopyWebpackPlugin. compress: true, host: HOST || config.dev.host, port: PORT || config.dev.port, open: config.dev.autoOpenBrowser, overlay: config.dev.errorOverlay ? { warnings: false, errors: true } : false, publicPath: config.dev.assetsPublicPath, proxy: config.dev.proxyTable, quiet: true, // necessary for FriendlyErrorsPlugin watchOptions: { poll: config.dev.poll, }, disableHostCheck: true, },
disableHostCheck: true, },