ReverseProxy and Docker?

**NethServer Version: NethServer 7.8.2003
Module: Webserver with virtual hosts and reverse proxy

So I run linuxserver/calibre-web via docker which I could access on the port :8083 since I opened this port and the container run with the network host (I know it is not the best).

My goal is to access MyNethserverIP/calibre and/or myDomain.tld/calibre which I believe it is possible with the ReverseProxy module.

image

  • yes I point to 127.0.0.1 since I use host as network.

but HTTP://MyNethserverIP/calibre return Error 404

Not Found

The requested URL /calibre was not found on this server.

while HTTP://MyNethserverIP:8083 keeps working well.
note: I also tried to point the ReverseProxy to MyNethserverIP but I still have the same result.


Here I found an example of Apache Reverse proxy for Calibre-Web

Listen 443

<VirtualHost *:443>
    SSLEngine on
    SSLProxyEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile "C:\Apache24\conf\ssl\test.crt"
    SSLCertificateKeyFile "C:\Apache24\conf\ssl\test.key"

    <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>
</VirtualHost>

Q1. Does somebody understand my mistake?

Q2. Do I need virtual hosts package?

Q3. do I have to make a config file manually?

Hi Jonathan,

It does only work with a website name matching rule (virtualhost reverse proxy), it does NOT work with IP.
A resource path matching rule (/calibre) does not work with calibre.

Docker setup:

docker create --name=calibre-web -e PUID=1000 -e PGID=1000 -e TZ=Europe/Vienna -e DOCKER_MODS=linuxserver/calibre-web:calibre -p 8083:8083 --restart unless-stopped linuxserver/calibre-web

Here’s my reverse proxy setup forcing SSL:

If the calibre-web machine is your DNS server a DNS entry for the virtualhost reverse proxy is added as alias automatically, otherwise you may need to setup a DNS entry on your DNS server:

You need to browse to https://calibre.web instead of https://nethserver/calibre.

No, only reverse proxy is needed.

No, except the RequestHeader directives are needed but at least the config page worked without.

3 Likes

you rock men, thank for your clear explaination :slight_smile:

3 Likes