RatingPosterDB / rpdb-folders

Monitors Media Folders and Adds Images with Ratings (poster.jpg / background.jpg) from the RPDB API
GNU Lesser General Public License v2.1
23 stars 2 forks source link

[Feature Request] BaseUrl option (for reverse proxy/proxypass) #23

Closed ghost closed 3 years ago

ghost commented 3 years ago

[Feature Request] BaseUrl option (for reverse proxy/proxypass)

Is your feature request related to a problem? Please describe. Right now the "only" way to access the RPDB-folders app is to use the port specified, "tied" with the host-url (127.0.0.1 or public IP). Without a base-url option, it's not possible to use reverse proxying for getting covered by the server's HTTPS certificate.

Describe the solution you'd like An option for setting a baseurl, so it's possible to do a reverse proxy / proxypass.

Additional context It could look like this, using nginx, with baseurl set to /rpdb (default port 8750):

location /rpdb {
    proxy_pass http://127.0.0.1:8750;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Host $server_name;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_read_timeout 90;
    proxy_set_header X-Forwarded-Proto $scheme;
    set $xforwardedssl "off";
    if ($scheme = https) {
            set $xforwardedssl "on";
    }
    proxy_set_header X-Forwarded-Ssl $xforwardedssl;
    proxy_redirect ~^(http(?:s)?://)([^:/]+)(?::\d+)?(/.*)?$ $1$2:$server_port$3;
}
jaruba commented 3 years ago

Sure, I'll add this as a hidden setting as some users can be confused by it and setting an invalid value could break the server.

ghost commented 3 years ago

Sounds great 👍

jaruba commented 3 years ago

This was added in v0.1.5 as a hidden setting, you can change baseUrl in config.json, the baseUrl you set should always end with the / character