C
Coder.com•3y ago
RealYHD

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
Phorcys
Phorcys•3y ago
I don't know if this is possible
bpmct
bpmct•3y ago
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?
RealYHD
RealYHD•3y ago
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.
Phorcys
Phorcys•3y ago
issue is that sub-paths usually break reverse proxying
sharkymark
sharkymark•3y ago
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).
RealYHD
RealYHD•3y ago
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.
Phorcys
Phorcys•3y ago
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
RealYHD
RealYHD•3y ago
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!
bpmct
bpmct•3y ago
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
No description
bpmct
bpmct•3y ago
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.
RealYHD
RealYHD•3y ago
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
bpmct
bpmct•3y ago
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?
RealYHD
RealYHD•3y ago
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.
Want results from more Discord servers?
Add your server