gatus: web.context-root is needed if the URL can not be rewritten.

At a1679ddc5e6c36e58fcfc75ece86bbe557e27709, web.context-root is deleted. But this option is needed in the environment which the URL can not be rewritten, for example Amazon ALB ingress controller. Would you please revive it?

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 13
  • Comments: 21 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I just opened a PR that tries to fix this: #908

I would also like to see this happen!

after some tries, here is what worked for me:

  • rebuild gatus fronend (npm --prefix web/app run build) with following changes
# set publicPath in vue.config.js
ARG VUE_PUBLIC_PATH
RUN sed -i \
    -e "s|publicPath: .*|publicPath: '${VUE_PUBLIC_PATH}'|" \
    web/app/vue.config.js

# use relative path '.' for SERVER_URL in main.js
RUN sed -i \
    -e "s|export const SERVER_URL = .*|export const SERVER_URL = '.'|" \
    web/app/src/main.js

# use relative path '.' for resources in index.html
RUN sed -i \
    -e 's|="/|="./|g' \
    web/app/public/index.html
  • and reverse proxy (only relevant lines from docker-compose)
build: { dockerfile: "Dockerfile", args: [ "VUE_PUBLIC_PATH=/gatus", ] }
labels:
- "traefik.http.middlewares.gatus.stripprefix.prefixes=/gatus"
- "traefik.http.routers.gatus.middlewares=gatus"
- "traefik.http.routers.gatus.rule=PathPrefix(`/gatus/`)"

@ansilh Could you make a PR for this? A section in the FAQ should suffice

Thanks for the detailed reply. You’ve made gatus very easy for people to build in docker themselves - thanks for that, too 😃 I tried setting publicPath: '/gatus/' in web/app/vue.config.js and then rebuilt it, hoping that a static root would work. Sadly it failed - it was still looking for its assets under /

w.r.t. CNAME reverse lookups, I’m not sure how it’s done, but my never-used-publicly CNAMEs are findable on the web, eg. via https://www.nmmapper.com/sys/tools/subdomainfinder/

Whether it’s some sort of active probing, or whether they just monitor certificate transparency logs, I don’t know. I generally use client certificates (handled by traefik) for my private domains (as well as passwords), so I’m reasonably confident that no-one can get in, but I like a bit of obscurity as well 😃