Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #527: Allow suburl to map the application #528

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Yunha-Lee
Copy link

@Yunha-Lee Yunha-Lee commented Sep 24, 2020

Instructions

Please try and perform pull requests against the develop branch.

Merging against the master branch causes a new release to be deployed, and I'd like to avoid that on every PR.

PR Details

Fixed an issue where the base url was ignored when calling the websocket api of the metrics page when accessing through a reverse proxy

Description

As already pointed out in issue #527, when accessing through a reverse proxy, when a url with a base path is used, the base path is ignored and the metrics page is not properly loaded. (e.g. https://www.example.com/elastichq)

The reason is that the subpath of the url entered when establishing a connection to the socket.io is recognized as a namespace. In order to use the subpath of the reverse proxy as it is, a custom path must be set separately.
For example, if you enter url as the following, the socket will connect to the elastichq namespace.

this.socket = io("https://www.example.com/elastichq");

To include elastichq in the custom path as intended, it should be modified as follows.

this.socket = io("https://www.example.com", { path: "elastichq/socket.io" });

So, I separated the url part and the baseurl part, and modified it to establish the connection in the correct way.
I tested through the nginx proxy environment of kubernetes, and it worked fine in my case. There seems to be a lot of similar questions, so I send a pull request with the modified version. If there is anything wrong, please comment. I hope it helps.

Related Issue

#527

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant