Hello, hope you’re all doing well.
I’m not sure how to format a Caddyfile for what I want, or if what I want is even possible currently.
I have a number of web apps running on a single server, on different ports.
I have Caddy set up as a transparent reverse proxy, giving each app a subdomain.
Ideally, I’d like to emulate Single Sign-On with basicauth - that is, once a user authenticates using basicauth at one subdomain, they won’t be prompted to reauthenticate at any other subdomain.
This can be done with Apache, as this StackOverflow answer details.
I was looking at basicauth Realms as a possible solution, but I’m not sure what the syntax for subdomains as realms would be, or if it would work.
Here’s a sample Caddyfile for what I have currently, without basicauth:
Caddyfile
www.vopeful.xyz, vopeful.xyz {
tls hello@vopeful.com
proxy / localhost:8088 {
}
}
app1.vopeful.xyz {
tls hello@vopeful.com
proxy / localhost:2222 {
transparent
}
}
app2.vopeful.xyz {
tls hello@vopeful.com
proxy / localhost:2435 {
transparent
}
}
app3.vopeful.xyz {
tls hello@vopeful.com
proxy / localhost:8765 {
transparent
}
}
app4.vopeful.xyz {
tls hello@vopeful.com
proxy / localhost:5643 {
transparent
}
}
app5.vopeful.xyz {
tls hello@vopeful.com
proxy / localhost:6665 {
transparent
}
}
app6.vopeful.xyz {
tls hello@vopeful.com
proxy / localhost:6666 {
transparent
}
}
app7.vopeful.xyz {
tls hello@vopeful.com
proxy / localhost:7777 {
transparent
}
}
Thank you in advance for any pointers you can provide!