NGINX reverse proxy to Coder web UI
Hi all, I was just wondering if anyone has experience setting up an NGINX reverse proxy to coder? I would like to have it running at a sub-path instead of a (sub-)domain. The current issue is that Coder seems to still be trying to access items at the domain root instead of the sub-path.
To elaborate, going to my.domain.com/coder results in a blank white page. Checking the dev-tools console, there are 404 failed to load resource errors. Checking which resources, it seems to be looking for
https://my.domain.com/bundle.04c5eed1b191f7762dd9.js
instead of https://my.domain.com/coder/bundle.04c5eed1b191f7762dd9.js
which does show the script. I've configured Coder with CODER_ACCESS_URL=https://my.domain.com/coder/
but this doesn't seem to be doing what I would like.
I may also just be misunderstanding something, so any help is appreciated! Thanks.13 Replies
I don't know if this is possible
I'm not sure if Coder can run on a sub-path right now 🤔 is this a requirement for you or is it possible to run it on a subdomain?
I figured this might be the case, that's unfortunate, but I appreciate the help!
It's not really a hard requirement but just due to how things are currently organized, it would make more sense for it to be on a sub-path rather than a sub-domain.
issue is that sub-paths usually break reverse proxying
Sounds like a valid use case even if technically it is hard. In many large organizations, getting a domain and subdomain is expensive and full of red tape (delay).
Agreed. On a separate note, sub-paths shouldn't break reverse proxying if thing's are configured correctly and the program itself accounts for the possibility such as recognising sub-path as a valid prefix for resource fetching and other server requests.
I'm not faulting Coder. Coder looks great, and definitely has a great community behind it, it'd be great if sub-path reverse proxying was an option.
I'm just saying it breaks stuff in general, not saying coder breaks with it
can you send me your config?
oh, nevermind
the link I sent was for code-server and not coder
so yeah it might be broken with Coder
Yeah, I recall looking at a few issues with solutions on this regarding code-server, but haven't seen anything for coder itself. I appreciate your efforts though!
I was able to reproduce this as well. I'll create an issue and we can track on GitHub.
A heads up: Not sure if it's something we can get to immediately
GitHub
Cannot run Coder on a path · Issue #4035 · coder/coder
Someone in our community ran into some issues running Coder on a path (https://mydomain.com/coder) and I was able to reproduce it.
Wow, thanks! I was gonna do it if nobody else was, just wanted someone to reproduce it though.
Yeah, taking some time on this is fine, I just hope it gets some attention eventually. If I get the chance to, I'll take a look at the code base and see if I can work on it myself :p
I don't think this is something we can add support in the short-term but I think we'd be open to contributions
Is this for a local network or something else?
Yeah, that's already good news. So many other services have support for sub-path reverse proxying and coder is really cool, so I think it's fitting
This is for a private software dev suite, it's a toy project for me, needs to be accessible outside of LAN.