Back-end Server Redirects, causes issues with proxy

Hi @Benjamin_Anderson,

These kinds of bugs appear frequently when you try to contain a web app in a single subfolder (/reports in this case).

The web app is built under the assumption that it controls the web root, so it directs you to /login.aspx under that assumption. Because the assumption is wrong, and you’re telling Caddy to only proxy requests beginning with /reports, those requests don’t ever reach the web app.

Moving forward, you’ve got two real options and one stopgap:

  1. Configure the web app with a base URL
    Some apps have a setting for this, which will have them prepend the URI with this subfolder whenever they redirect or generate links. Many apps don’t have such a setting. If you can find it, set the Base URL to /reports.

  2. Give the web app the whole web root
    For example, by using a subdomain instead of a subfolder, and using proxy / instead of proxy /reports.

  3. Proxy additional endpoints to the web app
    Basically, add another proxy directive for /login.aspx. This is the stopgap, and I liken this kind of fix to using your fingers to plug holes in your boat. You might find out later on that there are other URIs that the app needs as well. Or, later on, the developer might push an update that does. Plex is an incredible, awful example of this.