1. Caddy version (caddy version
):
2.0.0-alpine
2. How I run Caddy:
a. System environment:
Docker (docker-compose.yml)
b. Command:
docker-compose up -d
c. Service/unit/compose file:
version: '3'
services:
caddy:
image: caddy:2.0.0-alpine
restart: always
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./site:/site
ports:
- "8190:8080"
d. My complete Caddyfile or JSON config:
:8080 {
log {
format single_field common_log
}
basicauth / {
XXX XXX
}
reverse_proxy /grafana/* {
to grafana:3000
}
reverse_proxy /phpldapadmin/* {
to phpldapadmin:80
}
route /influxdb/* {
uri strip_prefix /influxdb
reverse_proxy influxdb:8086
}
route /ldapum/* {
uri strip_prefix /ldapum
reverse_proxy ldapum:80
}
root * /site
file_server browse
}
3. The problem I’m having:
I can’t properly access influxdb and ldapum through reverse_proxy since I can’t get the sub-paths of that applications working. I can access the main page, but can’t access any other ressource when working with the webpage.
In example of Influxdb it remains a blank page since it can’t access a certain js-file
In the case of ldapum I can see the main page, press on log in but after that I get a HTTP 404 because the request to /log_in/ is failed - it can’t find the correct path to that file. When accessing the main page, the URL is :8190/ldapum/ but after pressing on log in, the URL changes to :8190/log_in/.
In both cases, when I manually change the URL to f.e. /influxdb/.js-file or /ldapum/log_in/ it finds the proper ressources and therefore I can access the page. So the files are there (obviously), but I couldn’t find a way to get it running properly.
4. Error messages and/or full log output:
HTTP 404 (can’t find the proper files because of wrong pathing)
5. What I already tried:
I’ve tried a couple of stuff, but here are some examples:
Normal reverse-proxy like grafana etc.
reverse_proxy /influxdb/* {
to influxdb:8086
}
reverse_proxy /ldapum/* {
to ldapum:80
}
Not stripping the prefix (couldn’t access anything then as far as I remember)
route /influxdb/* {
reverse_proxy influxdb:8086
}
route /ldapum/* {
reverse_proxy ldapum:80
}
Some tries to somehow rewrite the url after reverse_proxy (as you can guess… without success).
I tried something with handle_path but I can’t correctly remind the specific code for granted (sorry for that).
I understand that the problem probably relies in the pathing, but I couldn’t solve it.
6. Links to relevant resources:
None