docker icon indicating copy to clipboard operation
docker copied to clipboard

Wallabag behind a reverse proxy with directory path

Open paulmorabito opened this issue 6 years ago • 7 comments

Hi,

I'm using the docker version of wallabag and trying to get it working behind an nginx reverse proxy with the /wallabag path. I've found a few mentions of this online but no configs. Is it possible to do this?

The closest I've gotten is using the domain name variable which works for loading images (when accessing via internal IP) but accessing via the reverse proxy gives a 404 error.

Thanks,

paulmorabito avatar Aug 05 '18 01:08 paulmorabito

you need to strip /wallabag from the path before forwarding to the the request to your wallabag host. https://serverfault.com/a/562850

e.g. in your nginx.conf:

location = /wallabag {
    return 302 /wallabag/;
}
location /wallabag/ {
    proxy_pass http://yourwallabaghost/;  # note the trailing slash here, it matters!
}

norweeg avatar Feb 03 '19 18:02 norweeg

Hi Does anyone know how to do this with Apache? I was using it as /wallabag on my server but now trying to dockerize it, so I need to run it as the same path.

I have this but this sends me back to `https://DOMAIN/login

ProxyPass /wallabag/ http://127.0.0.1:3080/
ProxyPassReverse /wallabag/ http://127.0.0.1:3080/

thanks

gerroon avatar Apr 26 '20 18:04 gerroon

I have this but this sends me back to `https://DOMAIN/login

I have the exact same problem when trying with Caddy server:

        route /wallabag/* {
                uri strip_prefix /wallabag
                reverse_proxy http://wallabag_server_1
        }

hydrargyrum avatar Oct 19 '20 20:10 hydrargyrum

A possible solution with nginx.conf could be another service on another port. But It has the limitation of having to log-in to (explicit) domain/login before access to domain.

...
server {
    listen 81;

    location / {
        proxy_set_header Accept-Encoding "";
        proxy_pass http://localhost:80/;
        sub_filter_types *;
        sub_filter_once off;
        sub_filter "https://your-wallabag-url-instance.com/" "/";
    }
}
...

But probably for the best solution check this GitHub repository https://github.com/RrOoSsSsOo/docker-wallabag-proxy

RrOoSsSsOo avatar Jan 11 '22 18:01 RrOoSsSsOo

But probably for the best solution check this GitHub repository https://github.com/RrOoSsSsOo/docker-wallabag-proxy

I couldn't figure out how to work with multiple domains, this worked perfectly for me! thanks! I needed to access my wallabag instance both from wallabag.mydomain.tld and localhost I just added a mount for "./fromGitHub/AppKernel.php:/var/www/wallabag/app/AppKernel.php" can it be implemented upstream? maybe as an option? Better yet if we could, instead, declare multiple domains

DanieleR87 avatar Jul 04 '22 11:07 DanieleR87

/fromGitHub/AppKernel.php:/var/www/wallabag/app/AppKernel.php"

It does not work for https://example.com/wallabag installations...

gabviv73 avatar Aug 04 '22 16:08 gabviv73

What do you mean? Have you edited the "./fromGitHub/AppKernel.php" mount to match your local copy of the modified AppKernel.php? I just noticed images load from the domain in the environment variable SYMFONY__ENV__DOMAIN_NAME, no matter which domain you access it from. I thought it worked correctly when I posted.

DanieleR87 avatar Aug 04 '22 18:08 DanieleR87