Webpack in development mode seems broken over HTTPS
Running gitlab in GDK and going through NGINX (i.e., enabling it in the Procfile and connecting to port 3443) results in a strange problem:
Although the error message claims it's trying to connect to http://localhost:3809, it's actually trying to talk HTTPS over that port, as the pry console demonstrates.
I can work around this by compiling the assets and disabling the development proxy, but it's not ideal.
My config/gitlab.yml
has the following:
## GitLab settings
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host: gitlab.mydomain
port: 3443
https: true # Set to true if using HTTPS, see installation.md#using-https for additional HTTPS configuration details
# ...
## Webpack settings
# If enabled, this will tell rails to serve frontend assets from the webpack-dev-server running
# on a given port instead of serving directly from /assets/webpack. This is only indended for use
# in development.
webpack:
dev_server:
enabled: true
host: localhost
port: 3809
I tried insertinghttps: false
into the webpack.dev_server section, but it had no effect. It seems config/initializers/static_files.rb
takes no account of it:
# If webpack-dev-server is configured, proxy webpack's public directory
# instead of looking for static assets
dev_server = Gitlab.config.webpack.dev_server
if dev_server.enabled
settings = {
enabled: true,
host: dev_server.host,
port: dev_server.port,
manifest_host: dev_server.host,
manifest_port: dev_server.port,
}
if Rails.env.development?
settings.merge!(
host: Gitlab.config.gitlab.host,
port: Gitlab.config.gitlab.port,
https: Gitlab.config.gitlab.https,
)
app.config.middleware.insert_before(
Gitlab::Middleware::Static,
Gitlab::Middleware::WebpackProxy,
proxy_path: app.config.webpack.public_path,
proxy_host: dev_server.host,
proxy_port: dev_server.port,
)
end
app.config.webpack.dev_server.merge!(settings)
end
/cc @mikegreiling