-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Ability to modify context path of the UI #1930
Comments
From looking at the code, i'd say you'll at least need to change the following:
There may be other places but i guess if all the unit tests pass and you can launch the ui both without the config and it defaults to /ui/ and with it set and it is available on the specified path then you'd be doing well. |
Adds -ui-path to agent command && ui_path field to config to allow custom ui path for web UI server; defaults to /ui/ Signed-off-by: Abhinav Dahiya <[email protected]>
Sorry for delay responding to this one, and thanks for the PR @abhinavdahiya. What use case do folks have in mind for configuring this? It's a simple change, but we'd like to avoid extra complexity unless there's a compelling reason to be able to tweak this. |
@slackpad When using location rewrites with nginx proxy, it should be possible to customize the URI on which consul ui responds. If my nginx proxy is setup to forward Does this help? |
Just FYI - I have made a few other enhancements that I think will help this. PR will be in coming shortly. TL;DR: Currently consul does not serve back full URL paths in its I'll reference back this issue on the PR when I'm ready. @abhinavdahiya maybe if you could look at it if you'd like and see if we could combine work to have the best of both patches. @slackpad your feedback would be welcome as well. |
This is closely related to #1382, but that also has the idea of changing the REST prefix, not just the UI. |
I think #2585 should be re-opened with support for the new UI for this to be fixed. |
Hi @pearkes |
long waiting. |
I'm finding it very difficult to track the progress of this across the last few years. Is there a current recommended solution to serving the The problem is very well documented. Is there a solution/hack/workaround? Is the only current solution to use subdomains? |
@jaredvacanti sadly the progress has been minimal. There is clear interest here so we want to get to it, just as always a matter of prioritization since it's not a totally trivial change. Thanks for your patience. |
Hi @s-christoff any progress to share on this feature please ? Thx |
Hey @rcarre thank you for checking in. I haven't started work on this yet, but it is on our radar to tackle in the next couple months. Thank you! |
While we wait for a proper implementation, here's a quick and dirty workaround using nginx reverse proxy and on-the-fly response rewriting. The three rules change paths for static assets, ember rest data source and ember router. Disclaimer: Tested on 1.5.0. Didn't yet test ACL tokens but it should work or should be easy to pass upstream.
|
Hey! This should be fixed in #5950 - thank you so much for your patience while we worked on this! |
Thx Sarah.
De : Sarah Christoff [mailto:[email protected]]
Envoyé : mercredi 26 juin 2019 20:45
À : hashicorp/consul
Cc : CARRE Richard 1 TGI/OLS; Mention
Objet : Re: [hashicorp/consul] Ability to modify context path of the UI (#1930)
Hey! This should be fixed in #5950<#5950> - thank you so much for your patience while we worked on this!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1930?email_source=notifications&email_token=AF4G6BKXWNBWZ3JZPUQLFLLP4O2JPA5CNFSM4CAN5XO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYUOX2Q#issuecomment-505998314>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AF4G6BJV7YFMRGDTVLRTVV3P4O2JPANCNFSM4CAN5XOQ>.
…_________________________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
|
I set this through config.json but I'm still being redirected to {"acl":{"default_policy":"allow","enable_token_persistence":true,"enabled":true},"bind_addr":"10.0.0.7","bootstrap_expect":3,"client_addr":"127.0.0.1 10.0.0.7","data_dir":"/opt/consul","enable_script_checks":true,"retry_join":["nomad-server-0","nomad-server-1","nomad-server-2"],"server":true,"ui":true,"ui_content_path":"/consul/"} Edit: after using the flag on the CLI things work as expected except it does not really solve the problem of reverse-proxying because the website still calls the api endpoints under |
@Fuco1 which consul version are you using? |
@i0rek 1.5.3 on linux 64bit, I downloaded the binary from the website. |
I confirm the problem also in the latest docker consul container. Related issue |
Something seems to set the referer header to Traefik config: [file]
[frontends]
[frontends.consul]
backend = "consul"
[frontends.consul.routes.consul]
rule = "PathPrefix:/consul"
[frontends.consul_api]
backend = "consul"
[frontends.consul_api.routes.consul]
rule = "HeadersRegexp:referer,https://MY-HOST.com/consul/.*"
[backends]
[backends.consul]
[backends.consul.servers.server1]
url = "http://nomad-server-0:8500/"
[backends.consul.servers.server2]
url = "http://nomad-server-1:8500/"
[backends.consul.servers.server3]
url = "http://nomad-server-2:8500/" Consul UI works correctly when I visit https://MY-HOST.com/consul/ |
Ok got it. In a normal deployment we can have ui in a different path, but in any case v1 point to the root path Anyway in case we want v1 on a different path than / we need to change some piece of code. Function related to it are: https://github.com/hashicorp/consul/blob/8ff1f481fe6f2ea2c3f7ba28a3739bacc1c0a753/api/api.go Also we need to modify a js (it is ember), because it uses v1 as namespace Obviously we need to do that with variables, so we need a configuration option to it (also to work in docker). As final result you can have the ui where you like and v1 where you like something like http://myhost.com/myv1/v1 It should works also with different ui based on ui-dir-path option. If the consul team like this solution we could work on it. |
Found a solution with traefik and docker |
I can confirm that the config option doesn't seem to work - in contrast to the cli flag |
We implemented a solution which might be worth mentioning here with nginx i.e. sharing consul and vault ui under the same nginx location -> /ui/consul + /ui/vault Just thought to share it here with everybody. |
I'd love to see the ability to specify the context path of the UI. Currently, the UI is available on
http://<bind-addr>:<http-port>/ui
. It would be awesome to have a-ui-content-path
option available to make it work with another path.I'd be happy to contribute if I could get some pointers on where the relevant code is. I have no knowledge about go at this moment in time but I learn quickly.
The text was updated successfully, but these errors were encountered: