DobyTang / LazyLibrarian

This project isn't finished yet. Goal is to create a SickBeard, CouchPotato, Headphones-like application for ebooks. Headphones is used as a base, so there are still a lot of references to it.
731 stars 70 forks source link

X-Forwarded-Proto header is ignored #1670

Closed alesnav closed 5 years ago

alesnav commented 5 years ago

Hello there,

I'm trying to set up a reverse proxy with SSL-offload to publish LazyLibrarian. It does work, but it tries to redirect continously to clear HTTP.

I am forwarding the HTTP header called X-Forwarded-Proto, which contains "https", but it seems that LazyLibrarian don't look at it.

This makes impossible to use LazyLibrarian in an iFrame if the parent frame was loaded using https, because of mixed content. For example, it it not possible to include in Organizr whn protected behind reverse proxy.

Radarr, Sonarr and Lidarr does support this feature.

Thanks!

doug-w commented 5 years ago

While it would be good to have it working properly, I have worked around this in nginx with the following config:

        location ~ ^/books/ {
                rewrite ^/books(/.*)$ $1 break;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass http://192.168.86.100:9000;
        }
alesnav commented 5 years ago

In nginx you can add proxy_redirect off, but I use traefik :(

location ~ ^/books/ {
                proxy_redirect off;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass http://192.168.86.100:9000;
        }
philborman commented 5 years ago

Development has moved to gitlab, and the issue may have already been fixed in later versions.
Please update to the latest version at https://gitlab.com/LazyLibrarian/LazyLibrarian
If the issue still occurs please open a new ticket on gitlab. Thanks