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

Possible to run behind reverse proxy under subpath? #26

Open
danwinkler opened this issue Mar 25, 2024 · 6 comments
Open

Possible to run behind reverse proxy under subpath? #26

danwinkler opened this issue Mar 25, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@danwinkler
Copy link

Hi,

Thanks for making wanderer!

I'm running wanderer on a k8s cluster behind a reverse proxy (Ingress NGINX Controller). I'd like to host wanderer at <my-hostname>/wanderer. I tried setting the ORIGIN envvar to include the /wanderer subpath, but it seems the app always wants to fetch assets from /_app, which causes things to break. Is there a way to make this work?

Thank you!

@Flomp
Copy link
Owner

Flomp commented Mar 25, 2024

Currently this is not possible. It shouldn't be too difficult though. You would probably need to implement a simple routing middleware in sveltekit. That said, I currently won't put it super high on my priority list. I will add it to the roadmap though.

@Flomp Flomp moved this to Backlog in wanderer Roadmap Mar 25, 2024
@Flomp Flomp added the enhancement New feature or request label Mar 25, 2024
@tofublock
Copy link
Contributor

I hope this belongs here, but it seems like it might be related:
I'm running Wanderer behind a reverse proxy as https://wanderer.domain.tld (no subpath), and page reloads on any page other than the root page (so, e.g. on https://wanderer.domain.tld/trails) result in a 502 Bad Gateway from Nginx:

nginx.1 | 2024/11/09 10:12:24 [error] 53#53: *6 upstream sent too big header while reading response header from upstream, client: 192.168.0.1, server: wanderer.domain.tld, request: "GET /trails HTTP/2.0", upstream: "http://172.29.1.1:3000/trails", host: "wanderer.domain.tld"
(Here's a Stackoverflow answer saying upstream sent too big header while reading response header from upstream is nginx's generic way of saying "I don't like what I'm seeing")

Since clicking the link on the page works just fine, I'm wondering if this might have something to do with routing in Svelte?

@tofublock
Copy link
Contributor

tofublock commented Nov 9, 2024

And one more piece of information: direct page reloads of https://wanderer.domain.tld/settings work fine, all other sub-paths (/profile, /trails, /map, /lists) don't.

@Flomp
Copy link
Owner

Flomp commented Nov 9, 2024

That's strange because the demo instance is running behind a nginx reverse proxy without any issues. Could you provide your nginx config?

@tofublock
Copy link
Contributor

Apologies, this is unrelated to the original topic.
First thing I did when I found the problem was trying to increase proxy buffer sizes and that didn't change anything. I tried again just now, and the problem went away. Here's the new sizes, for anybody coming after me:

proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;

Sorry again. Awesome work with the project!

@gri38
Copy link

gri38 commented Nov 19, 2024

Hello.
Same need here: I would like a parameter to set a subpath to the frontend, so it can request:
https://mydomain.com/sub/path/wanderer/xxx, instead of https://mydomain.com/xxx

My nginx rewrites this url to: http://docker-wandrer-web-service-name:3000.

BTW: thanks a lot for that awesome project !! You contribute to provide a clean web, not depending on the ad. That's very valuable, thanks.

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
Status: Backlog
Development

No branches or pull requests

4 participants