I’m trying to run the app behind Nginx under a subpath (/ladder/) instead of at the domain root or on a dedicated port.
Direct access works fine, but access through the reverse proxy subpath does not behave correctly.
What works
Using:
ladder:
container_name: ladder
image: ghcr.io/everywall/ladder:latest
restart: unless-stopped
build: .
ports:
- "8080:8080"
environment:
- PORT=8080
- LOG_URLS=true
- RULESET=https://raw.githubusercontent.com/everywall/ladder-rules/main/ruleset.yaml
Then visiting:
loads the startup page UI correctly and the app works normally.
What does not work
When I put the app behind Nginx at:
the homepage does not load correctly, even though some nested paths do work. For example: http://localhost/ladder/b works while http://localhost/ladder and http://localhost/ladder/ do not behave like the direct-root homepage.
The proxy configuration is
events {}
http {
server {
listen 80 default_server;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
location = /ladder {
return 301 /ladder/;
}
location /ladder/ {
proxy_pass http://ladder:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
The problem seems to be specifically that the app’s homepage are not preserving the /ladder/ prefix and instead appear to assume the app is hosted at /.
Do you guys have a similar issue?
I’m trying to run the app behind Nginx under a subpath (
/ladder/) instead of at the domain root or on a dedicated port.Direct access works fine, but access through the reverse proxy subpath does not behave correctly.
What works
Using:
Then visiting:
loads the startup page UI correctly and the app works normally.
What does not work
When I put the app behind Nginx at:
the homepage does not load correctly, even though some nested paths do work. For example:
http://localhost/ladder/bworks whilehttp://localhost/ladderandhttp://localhost/ladder/do not behave like the direct-root homepage.The proxy configuration is
The problem seems to be specifically that the app’s homepage are not preserving the
/ladder/prefix and instead appear to assume the app is hosted at/.Do you guys have a similar issue?