jippi / hashi-ui

A modern user interface for @hashicorp Consul & Nomad
MIT License
1.23k stars 148 forks source link

PROXY_ADDRESS breaks direct access w/o reverse proxy #599

Open tommyalatalo opened 4 years ago

tommyalatalo commented 4 years ago

Using PROXY_ADDRESS breaks access to hashi-ui directly using http://ip:port address.

Reproduce:

  1. Skip setting PROXY_ADDRESS, configuration:
    CONSUL_ADDR="http://consul.service.consul:8500"
    CONSUL_ENABLE="true"
    CONSUL_READ_ONLY="true"
    NOMAD_ADDR="http://nomad-servers.service.consul:4646"
    NOMAD_ENABLE="true"
    SERVICE_IMAGE="jippi/hashi-ui"
    SERVICE_VERSION="v1.3.8"
    NOMAD_READ_ONLY="true"
    NOMAD_HIDE_ENV_DATA="true"

Result: hashi-ui reachable at http://localhost:3000, redirects to http://localhost:3000/nomad/, works as expected.

  1. Set PROXY_ADDRESS="/hashi-ui", otherwise same config as above

Result: hashi-ui at localhost:3000 redirects to http://localhost:3000/hashi-ui/nomad/ and shows Error: Unable to connect to the backend....

Route through traefik (http://traefik:80/hashi-ui) works, configured as:

"traefik.enable=true",
"traefik.http.routers.hashi-ui.entrypoints=api",
"traefik.http.routers.hashi-ui.rule=PathPrefix(`/hashi-ui`)",
"traefik.http.routers.hashi-ui.middlewares=hashi-ui_stripprefix",
"traefik.http.middlewares.hashi-ui_stripprefix.stripprefix.prefixes=/hashi-ui",

So the sum behavior above is that I can't get hashi-ui working both with direct access and via traefik at the same time. Did I configure something wrong, or is this a bug, because I would've expected the direct access to still work?

zakabluk commented 3 years ago

The same issue!