Unable to run webpack development server on HTTP in development

Summary

  • I run the GitLab app server on HTTPS
  • The webpack development server inherits HTTPS settings (as it should) from the app server. So if the app server is on HTTPS, the webpack dev server is on HTTPS
  • The rails server isn't able to connect to the webpack dev server since the latter uses a self-signed certificate
  • Since this is meant for development use only, we should turn off certificate verification while communicating with the webpack dev server
  • We want to fix this by running the webpack server on HTTP. This currently doesn't work, because (in development), we're forcing the status of HTTPS for the webpack server to be the same as that of the GitLab server, rather than respecting the webpack.dev_server.https config value.

Steps to reproduce

  • Set gitlab.https: true and webpack.dev_server.https: false in gitlab.yml. Restart app server.
  • Start webpack dev server with HTTP enabled. I do this by running webpack-dev-server --port 3808 --config config/webpack.config.js.
  • Load GitLab in a browser

Expected behavior

  • The app loads as expected, with all frontend dependencies loaded through the webpack proxy

Actual behavior

  • The app loads, but application.js is not fetched due to a 500 error.

/cc @mikegreiling