title: How to forward http requests to https with webpack?
body: <p>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?</p>
  
  <p>on package.json, the relevant script is:</p>
  
  <pre><code>"start:staging": "webpack-dev-server --config config/webpack.server.stage.config.js --mode production --open --host 0.0.0.0 --port 443",
  </code></pre>
  
  <p>on webpack.server.config.js:</p>
  
  <pre><code>module.exports = {
  ...
      devServer: {
          historyApiFallback: true,
          contentBase: '/',
          public: &lt;my domain&gt;,
          https: {
              key: key,
              cert: cert,
              ca: ca
          }  
      }
  ...
  </code></pre>
  
  <p>I tried playing with <code>proxy</code> options but couldn't make it to work.
  Any assistance would be much appreciated. </p>