Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subpath/baseurl option #153

Open
abd3-13 opened this issue Jul 11, 2024 · 0 comments
Open

subpath/baseurl option #153

abd3-13 opened this issue Jul 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@abd3-13
Copy link

abd3-13 commented Jul 11, 2024

Firstly thanks for the app, nice and simple one place media app, It would be nice to access it on subpaths/subdirectory like 10.5.2.4:8585/reiverr or media.home.com/reiverr

some feedback":
1 - an option in setting to add base url like '/reiverr/''
2 - or an option to add base url on env variable
3 - or make it reverse proxy on subpath compatible

i have tried to make a location block on my nginx proxy it works on the homepage but breaks on sources,library,settings discover pages

nginx:

location /rei/ {
        proxy_set_header    X-Real-IP  $remote_addr;
        proxy_set_header    X-Forwarded-Proto $scheme;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header    Host $http_host;
        proxy_http_version  1.1;
        proxy_set_header    Upgrade $http_upgrade;
        proxy_set_header    Connection "upgrade";

        proxy_pass          http://127.0.0.1:764/;
        
        # define url prefix
        set                 $url_prefix rei;
        # remove url prefix to pass to backend
        rewrite             ^/rei/?(.*)$ /$1 break;
        rewrite_log         on;
        # redirect location 
        proxy_redirect      ^ /$url_prefix;
        proxy_redirect      /discover /$url_prefix/discover;
        proxy_redirect      /library /$url_prefix/library;
        proxy_redirect      /sources /$url_prefix/discover;
        proxy_redirect      /settings /$url_prefix/settings;
        proxy_redirect      /series /$url_prefix/series;
        proxy_redirect      /genres /$url_prefix/genres;
        proxy_redirect      /networks /$url_prefix/networks;
        
        # sub filters to replace hardcoded paths
        proxy_set_header    Accept-Encoding "";
        sub_filter_last_modified on;
        sub_filter_once     off;
        sub_filter_types    *;
        sub_filter          '(?!.*\.themoviedb\.org|.*\.tmdb\.org).*/discover/' '/$url_prefix/discover/';
        sub_filter          '/networks/' '/$url_prefix/networks/';
        sub_filter          '/genres/' '/$url_prefix/genres/';
        sub_filter          '/series/' '/$url_prefix/series/';
        sub_filter          '/settings/' '/$url_prefix/settings/';
        sub_filter          '/sources/' '/$url_prefix/sources/';
        sub_filter          '/library/' '/$url_prefix/library/';
        sub_filter          '"/settings' '"/$url_prefix/settings';
        sub_filter          '"/sources' '"/$url_prefix/sources';
        sub_filter          '"/library' '"/$url_prefix/library';
    }
    
    

Reiverr version 1.1.1
Nginx is on 0.0.0.0:763
Reiverr is on 0.0.0.0:764, is a served by running NODE_ENV="production" PORT=764 node build/ on a node alpine container

Error for sources,library,settings pages

Reiverr subpath error

i am not expert in nginx, node, this is a mix and match of my research on web and AI,

@aleksilassila aleksilassila added the enhancement New feature or request label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants