ElasticHQ / elasticsearch-HQ

Monitoring and Management Web Application for ElasticSearch instances and clusters.
http://www.elastichq.org
Other
4.96k stars 532 forks source link

Use port 80 is explicitly added to the host. Fixes #432 and #148 #434

Closed bucha closed 5 years ago

bucha commented 6 years ago

It's now possible to explicitly add :80 to the host. Formerly the UI part would just have stripped the port away which results in the backend part to default to 9200.

If you have your ES cluster behind a proxy on port 80, this will enable HQ to connect to it.

ncsibra commented 5 years ago

+1, have the same issue.

pcasa commented 5 years ago

@bucha can you modify the pull request to the following. This way if port is passed in explicitly it will assign it, else default to the URL parser.

 port: ( this.connection.match(/:(\d+)/) ? this.connection.match(/:(\d+)/)[1] : uri.port),
bucha commented 5 years ago

@pcasa I've changed the code as you proposed. Ideally though, I would expect the URL parser to handle this by itself on day, which is why I prioritized it earlier.

EDIT: Code untested