Watcharr icon indicating copy to clipboard operation
Watcharr copied to clipboard

Hosting from subpath via reverse proxy

Open schmurian opened this issue 1 year ago • 2 comments

Hi,

I have another question: Would it be possible to access Watcharr from a subpath via nginx or similar reverse proxies?

An example configuration could look something like this in nginx:

...
location /watcharr/ {
                proxy_pass http://localhost:3080/;
                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_set_header X-Forwarded-Proto $scheme;
        }
...

schmurian avatar Jan 11 '24 06:01 schmurian

Hi @schmurian, the beta site is hosted behind a reverse proxy using Caddy. I have never tried doing it behind a subpath (nor have I used nginx before), but I will try giving it a go to see if it works.


I think I see the problem, the links/redirects won't include the new base path which causes it to break. I'll look into how we can fix that, probably a new base url setting.


Yep, this is harder than I thought. The only thing I can think of is to manually add the base url (if set) to the start of each url.

I can live with that solution, but it seems very prone to being broken when I inevitably forget to do it.

Going to think some more and probably just do it anyways because I'm not that smart.

IRHM avatar Jan 11 '24 22:01 IRHM

Please don't stress about this request. Yes, you're right, I've seen the base path being exposed in other docker configuration files, but I remember it can be complex to implement it in a way that it doesn't break things. I can use a subdomain instead in nginx.

Thank you for looking into it though!

schmurian avatar Jan 12 '24 07:01 schmurian