I’m using a self-hosted password management service called Psono. It worked perfectly under nginx using the example config file provided in their documentation.
Now I’m migrating from nginx to caddy, but I simply can’t wrap my head around the configuration with these many added headers and rewrites.
Psono has two subdirectories. /server would lead to the password-management service itself (not a webpage), and /portal should have to lead to the admin page (and it is actually /portal/login, but nginx took care of redirecting.
The latter works sort of… now I have to explicitly write psono.beeswax.eu/portal/login to access the login screen of the admin panel.
The former doesn’t work at all, if I try to login from the main page it states Server offline - it’s online, if I switch back to nginx, it is working.
My other sites - which were only need a simple reverse_proxy - works perfectly.
4. Error messages and/or full log output:
5. What I already tried:
I tried to format the caddyfile as it is in nginx’s configfile, but ultimately failed…
will only match /server but not /server/ or /server/something.else.
reverse_proxy /portal/* localhost:10102
on the other hand matches /portal/ and /portal/something.else but not /portal.
If you want to match /portal (without a trailing slash) too, you could write it as
I think it’s easier to read – you can clearly see top-down how a request will be handled. The handle without a matcher will catch any request that wasn’t otherwise matched by the previous 2 handles.