[Bug]: Update readme - reverse proxy (Caddy) on subdir login - OpenVPN complication #2843

Closed
opened 2026-04-25 00:11:14 +02:00 by adam · 2 comments
Owner

Originally created by @gundestrup on GitHub (Jun 14, 2025).

What happened?

Login not working when access ABS over VPN using Caddy as reverse proxy

What did you expect to happen?

that it worked

Steps to reproduce the issue

  1. Using the official documentation for reverse proxy and caddy
    https://github.com/advplyr/audiobookshelf#reverse-proxy-set-up
    This should work
subdomain.domain.com {
        encode gzip zstd
        reverse_proxy <LOCAL_IP>:<PORT>
}

But since
https://github.com/advplyr/audiobookshelf/discussions/3535
and https://github.com/advplyr/audiobookshelf/issues/385

You need to add a second handler for the login part, since it at /audiobookshelf
Else you just get an error SSL/HTTP when access the url directly, not using the subfolder part.

like this

subdomain.domainname.com {
	handle {
		reverse_proxy <IP address>:<port> {
			header_up Host {upstream_hostport}
		}
	}

	handle {
		rewrite * /audiobookshelf{uri}
		reverse_proxy <IP address>:<port> {
			header_up Host {upstream_hostport}
		}
	}
}

I ended up using a lot of time debugging vpn, caddy to find the error.
I found out if I just access the sub dir directly the login worked.
And the only solution I could make work was this work around.

What tricked me was the my android app, over vpn worked, but access the server via browser just showed an SSL/HTTP error.

Audiobookshelf version

2.24

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Other (list in "Additional Notes" box)

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

no nessesary

Additional Notes

TrueNAS os
Caddy on Opnsense box
VPN (OpenVPN) on Opnsense box
SSL certificate via ACME, wildcard certificate.

Thanx for a really great program

Originally created by @gundestrup on GitHub (Jun 14, 2025). ### What happened? Login not working when access ABS over VPN using Caddy as reverse proxy ### What did you expect to happen? that it worked ### Steps to reproduce the issue 1. Using the official documentation for reverse proxy and caddy https://github.com/advplyr/audiobookshelf#reverse-proxy-set-up This should work ```yaml subdomain.domain.com { encode gzip zstd reverse_proxy <LOCAL_IP>:<PORT> } ```` But since https://github.com/advplyr/audiobookshelf/discussions/3535 and https://github.com/advplyr/audiobookshelf/issues/385 You need to add a second handler for the login part, since it at /audiobookshelf Else you just get an error SSL/HTTP when access the url directly, not using the subfolder part. like this ```yaml subdomain.domainname.com { handle { reverse_proxy <IP address>:<port> { header_up Host {upstream_hostport} } } handle { rewrite * /audiobookshelf{uri} reverse_proxy <IP address>:<port> { header_up Host {upstream_hostport} } } } ``` I ended up using a lot of time debugging vpn, caddy to find the error. I found out if I just access the sub dir directly the login worked. And the only solution I could make work was this work around. What tricked me was the my android app, over vpn worked, but access the server via browser just showed an SSL/HTTP error. ### Audiobookshelf version 2.24 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Other (list in "Additional Notes" box) ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs ```shell no nessesary ``` ### Additional Notes TrueNAS os Caddy on Opnsense box VPN (OpenVPN) on Opnsense box SSL certificate via ACME, wildcard certificate. Thanx for a really great program
adam added the bug label 2026-04-25 00:11:14 +02:00
adam closed this issue 2026-04-25 00:11:15 +02:00
Author
Owner

@Vito0912 commented on GitHub (Jun 14, 2025):

I don't know Caddy specifically, but assuming it works just like any other reverse proxy this should not be needed.

Audiobookshelf just added /audiobookshelf as a subdirectory. But both paths still work. The web app just uses redirects to /audiobookshelf. But this should normally not matter for reverse proxies as ABS just accepts it.
The SSL error sounds a bit odd to me, because then something like /audiobookshelf/item should also throw an error, shouldn't it?

Also please format the code properly so it's more readable

@Vito0912 commented on GitHub (Jun 14, 2025): I don't know Caddy specifically, but assuming it works just like any other reverse proxy this should not be needed. Audiobookshelf just added /audiobookshelf as a subdirectory. But both paths still work. The web app just uses redirects to /audiobookshelf. But this should normally not matter for reverse proxies as ABS just accepts it. The SSL error sounds a bit odd to me, because then something like /audiobookshelf/item should also throw an error, shouldn't it? Also please format the code properly so it's more readable
Author
Owner

@gundestrup commented on GitHub (Jun 16, 2025):

I am investigating further.
I am proberly looking at a problem in DNS resolver over vpn, that is part of the problem.
I am closing this bug for know, since I am uncertain where the problem lies.

@gundestrup commented on GitHub (Jun 16, 2025): I am investigating further. I am proberly looking at a problem in DNS resolver over vpn, that is part of the problem. I am closing this bug for know, since I am uncertain where the problem lies.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2843