I have a webpack configuration of an https webserver. When an http request arrives, it just returns ERR_CONNECTION_REFUSED. How can I configure it to forward all http requests to https?
on package.json, the relevant script is:
"start:staging": "webpack-dev-server --config config/webpack.server.stage.config.js --mode production --open --host 0.0.0.0 --port 443",
on webpack.server.config.js:
module.exports = {
...
devServer: {
historyApiFallback: true,
contentBase: '/',
public: <my domain>,
https: {
key: key,
cert: cert,
ca: ca
}
}
...
I tried playing with proxy
options but couldn't make it to work.
Any assistance would be much appreciated.
It seems that webpack have issue for this feature. Just linking it for anybody who would come here https://github.com/webpack/webpack-dev-server/issues/126.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With