Redirect to login.html is incorrect when using a reverse proxy
Prerequisites
I have checked the Wiki and Discussions and found no answer
I have searched other issues and found no duplicates
I want to report a bug and not ask a question or ask for help
I have set up AdGuard Home correctly and configured clients to use it. (Use the Discussions for help with installing and configuring clients.)
Platform (OS and CPU architecture)
FreeBSD, AMD64 (aka x86_64)
Installation
Custom package (OpenWrt, HomeAssistant, etc; please mention in the description)
Setup
On one machine
AdGuard Home version
0.107.36
Action
When using AdGuard Home behind a reverse proxy (Apache 2.4 in this case), unauthenticated users are redirected to /login.html, which causes issues when placed behind a subdirectory. The naive fix for this would be a relative redirect (eg. login.html.
My Apache configuration (which should be equivalent to the documented nginx configuration) is:
ProxyPreserveHost On
ProxyPass /adguard/ http://localhost:3000/
ProxyPassReverse /adguard/ http://localhost:3000/
ProxyPassReverseCookiePath /adguard/ /Thanks in advance!
Expected result
Redirects work when using a reverse proxy from a subdirectory (eg. /adguard/login.html).
Actual result
An absolute redirect to /login.html is performed.
Additional information and/or screenshots
FreeBSD 13.2-RELEASE-p9; installed using the www/adguardhome port.
Source: AdguardTeam/AdGuardHome