Help doing a backend rebuild with subpath instead of subdomains

1. The problem I’m having:

I need to do a backend rebuild sometime soon and my current convention for getting access to websites is using the reverse_proxy function similar to the attached. What I’m wanting to do is access my services via subpath instead of subdomains.

https://staff.dragonhowl.games/kanban instead of https://kanban.dragonhowl.games or https://kanban.staff.dragonhowl.games

The problem I’m having here is from my understanding subpaths are simply not built for this and reverse_proxy doesn’t really do what I’m wanting it to do. I had a look at the rewrite argument and that allows me to access a particular service with a subpath, but if that service has it’s own path then it breaks trying to access it.

What I’m wanting overall is for the end users in my team to have an easy to read and convenient way to access my services and having to do long convoluted subdomains like kanban.staff.dragonhowl.games is super not pleasing to look at.

Would hugely appreciate it if someone has a solution for me since I’m kinda stuck.

2. Error messages and/or full log output:

Nothing

3. Caddy version: v2.6.4

v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=

4. How I installed and ran Caddy:

Caddy installed with xCaddy, running with Systemctl.

a. System environment:

Ubuntu Server Pro 22.04 running on Proxmox VE 7 running on a Ryzen 9 3950X.

b. Command:

sudo systemctl restart caddy.service

c. Service/unit/compose file:

# caddy.service
#
# For using Caddy with a config file.
#
# Make sure the ExecStart and ExecReload commands are correct
# for your installation.
#
# See https://caddyserver.com/docs/install for instructions.
#
# WARNING: This service does not use the --resume flag, so if you
# use the API to make changes, they will be overwritten by the
# Caddyfile next time the service is restarted. If you intend to
# use Caddy's API to configure it, add the --resume flag to the
# `caddy run` command or use the caddy-api.service file instead.

[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target

[Service]
Type=notify
User=caddy

d. My complete Caddy config:

wiki.dragonhowl.games {
reverse_proxy http://10.1.7.100:1180 {
}
tls /etc/caddy/dh-cert.pem /etc/caddy/dh-key.pem
}

5. Links to relevant resources:

See this article:

Your upstream apps would need to support a “base path” config for it to work correctly, otherwise you’ll have problems.

In general, we recommend using subdomains because it’s essentially guaranteed to work without any complicated setup.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.