ChuckMac / ADRFinder

Self-Hosted, Open Source, Advanced Dining Reservation Notifications for Disney World
Apache License 2.0
37 stars 11 forks source link

BASE_URL for non-root URL paths #18

Closed CoocooFroggy closed 1 year ago

CoocooFroggy commented 1 year ago

Version and OS v0.2.9, macOS

It would be great if BASE_URL worked to run the app on alternative paths. For example, https://example.com/adr/. Right now, every link on the website is relative to /, but when running multiple web apps on a single machine, they can't all run on the main path. I use a nginx reverse proxy to separate the apps, which works somewhat for ADRFinder, but breaks all links when clicked and css / images.

ChuckMac commented 1 year ago

Check the instructions for ChangeDetection (from which this is based) for non-root URL in nginx.

https://github.com/dgtlmoon/changedetection.io/wiki/Running-changedetection.io-behind-a-reverse-proxy

Haven't tried it myself so if that doesn't work let me know.

CoocooFroggy commented 1 year ago

Hm so I have this in my nginx config

location /adr/ {
    proxy_pass http://localhost:5500/;
        proxy_set_header Host "localhost";
        proxy_set_header X-Forwarded-Prefix /adr;
        proxy_set_header X-Forwarded-Proto $scheme;
}

but it's still linking to root URL paths, not /adr paths.

CoocooFroggy commented 1 year ago

My bad. Needed to add USE_X_SETTINGS=1 to the docker-compose.

version: '2'
services:
    adrfinder:
      image: ghcr.io/chuckmac/adrfinder
      container_name: adrfinder
      hostname: adrfinder
      volumes:
        - ./datastore:/datastore
      ports:
        - 5500:5500
      restart: unless-stopped
      environment:
        - USE_X_SETTINGS=1

Thank you so much for the help!