Score:0

Apache2 mod_substitute not modifying URLs

bh flag

I'm trying to use Apache2 as a reverse proxy to access an application (calibre web) running inside a Docker container. Since the application is using redirects (more details here), I'm trying to use apache's mod_substitute to modify the URLs in the redirects so they point to the right URL. I wrote the following inside a file called calibreweb.conf and enabled both the site and the substitute mod.

<Location /calibre-web>
    ProxyPass http://127.0.0.1:8083
    ProxyPassReverse http://127.0.0.1:8083
    AddOutputFilterByType SUBSTITUTE text/html
    Substitute "s|https://subdomain.example.com/|https://subdomain.example.com/calibre-web/|i"

</Location>

The problem is that, after restarting Apache, the mod isn't doing anything. As a sanity check I tried changing the substitute pattern to Substitute "s|admin|user|i", as the first redirect contains admin, but I still get redirected to subdomain.example.com/admin/dbconfig. Adding SetOutputFilter SUBSTITUTE,DEFLATE just above the AddOutputFilterByType line didn't help. Also removing the content-type filter so that the file becomes

<Location /calibre-web>
    ProxyPass http://127.0.0.1:8083
    ProxyPassReverse http://127.0.0.1:8083
    Substitute "s|https://nas.gtpware.eu/|https://nas.gtpware.eu/calibre-web/|i"

</Location>

didn't fix it. Any idea why this doesn't work? It looks like the example given in Apache2's documentation to me. Thank you for your help,

GTP95

Score:0
bh flag

Turns out that Calibre web has a working example in their wiki here. It boils down to:

<Location /calibre-web >
        RequestHeader set X-SCRIPT-NAME /calibre-web
        RequestHeader set X-SCHEME https
        ProxyPass http://localhost:8083/
        ProxyPassReverse http://localhost:8083/
        ProxyPassReverseCookiePath  /  /calibre-web/
</Location>
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.