Closed deavmi closed 1 week ago
Hey thanks for raising a issue - do you mind pasting your nginx config so I can try to replicate?
I actually haven't run it in front of a reverse proxy so it's a good question :)
Let me get that for you
On 08 November 2024 09:10:02 SAST, Brendan Kellam @.***> wrote:
Hey thanks for raising a issue - do you mind pasting your nginx config so I can try to replicate?
I actually haven't run it in front of a reverse proxy so it's a good question :)
-- Reply to this email directly or view it on GitHub: https://github.com/sourcebot-dev/sourcebot/issues/61#issuecomment-2463924965 You are receiving this because you authored the thread.
Message ID: @.***>
Tristan B. Velloza Kildaire
Web: https://deavmi.assigned.network BNET IRC: deavmi Email: @.***
Here we go:
# sourcebot
location ^~ /bot/
{
proxy_pass http://sourcebot:3000/;
proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
# by default nginx times out connections in one minute
proxy_read_timeout 1d;
}
thanks - I'm heading to bed now but I will try this out in the morning. Could you also send over any logs / further describe what the issue is?
Sure. Will do when at home
On 08 November 2024 09:53:15 SAST, Brendan Kellam @.***> wrote:
thanks - I'm heading to bed now but I will try this out in the morning. Could you also send over any logs / further describe what the issue is?
-- Reply to this email directly or view it on GitHub: https://github.com/sourcebot-dev/sourcebot/issues/61#issuecomment-2463983695 You are receiving this because you authored the thread.
Message ID: @.***>
Tristan B. Velloza Kildaire
Web: https://deavmi.assigned.network BNET IRC: deavmi Email: @.***
Hi, so I don't really have much logs but I can show you what it renders like:
If I open the Network log, in chromiu, it seems all requests are being made at the root /
and *not** /bot/
, that is the problem
Any updates on this?
Sorry I haven't gotten a chance to look into this yet - I will take a look today and get back to you
Thanks man, appreciate it a lot :-)
On 14 November 2024 20:09:35 SAST, Brendan Kellam @.***> wrote:
Sorry I haven't gotten a chance to look into this yet - I will take a look today and get back to you
-- Reply to this email directly or view it on GitHub: https://github.com/sourcebot-dev/sourcebot/issues/61#issuecomment-2477095827 You are receiving this because you authored the thread.
Message ID: @.***>
Tristan B. Velloza Kildaire
Web: https://deavmi.assigned.network BNET IRC: deavmi Email: @.***
Heya - I was able to repro the issue. As you mentioned, all CSS, JS, and image requests are 404'ing since they are referencing the root /
and not the redirected /bot
path:
I looked into it and Next.js has a basePath config variable that I tested and seemed to work. One fix here may be to make that configurable and expose a BASE_PATH
env var that gets passed tobasePath
. I can look into that tomorrow.
In the meantime, would it be possible to serve it directly at the root /
? Or possibly, use a subdomain?
I like the BASE_PATH
envvar approach.
Currently it won't be possible for me to serve it at the root as I have other stuff on /
On 15 November 2024 09:55:32 SAST, Brendan Kellam @.***> wrote:
Heya - I was able to repro the issue. As you mentioned, all CSS, JS, and image requests are 404'ing since they are referencing the root
/
and not the redirected/bot
path:I looked into it and Next.js has a basePath config variable that I tested and seemed to work. One fix here may be to make that configurable and expose a
BASE_PATH
env var that gets passed tobasePath
. I can look into that tomorrow.In the meantime, would it be possible to serve it directly at the root
/
? Or possibly, use a subdomain?-- Reply to this email directly or view it on GitHub: https://github.com/sourcebot-dev/sourcebot/issues/61#issuecomment-2478166278 You are receiving this because you authored the thread.
Message ID: @.***>
Tristan B. Velloza Kildaire
Web: https://deavmi.assigned.network BNET IRC: deavmi Email: @.***
Hey @deavmi - I just opened a PR with this change. I have validated it locally with my nginx conf file and all seems to work. If you have a sec, would you mind checking out my branch, building a image, and testing with your config?
Hi, I will give this a try sometime in tonight or early tomorrow morning. Thanks!
On 16 November 2024 08:50:41 SAST, Brendan Kellam @.***> wrote:
Hey @deavmi - I just opened a PR with this change. I have validated it locally with my nginx conf file and all seems to work. If you have a sec, would you mind checking out my branch, building a image, and testing with your config?
-- Reply to this email directly or view it on GitHub: https://github.com/sourcebot-dev/sourcebot/issues/61#issuecomment-2480454087 You are receiving this because you were mentioned.
Message ID: @.***>
Tristan B. Velloza Kildaire
Web: https://deavmi.assigned.network BNET IRC: deavmi Email: @.***
Hey @deavmi - I just opened a PR with this change. I have validated it locally with my nginx conf file and all seems to work. If you have a sec, would you mind checking out my branch, building a image, and testing with your config?
Want me to build from source the Dockerimage
?
Hey @deavmi - I just opened a PR with this change. I have validated it locally with my nginx conf file and all seems to work. If you have a sec, would you mind checking out my branch, building a image, and testing with your config?
Want me to build from source the
Dockerimage
?
Had difficulties doing this, maybe a ghcr release (alpha) for this branch would do?
No worries - I will just merge the PR now to main and that will kickoff a ghcr release to main
. If there are issues, we can open up another PR after
No worries - I will just merge the PR now to main and that will kickoff a ghcr release to
main
. If there are issues, we can open up another PR after
Cool cool, I will be up tonight and can test in the next hours :)
Waiting on the artm64
image to be built... QEMU speedz
BASE_PATH
Should I set BASE_PATH
to https://example.com/bot
?
Set DOMAIN_SUB_PATH
to /bot
Set
DOMAIN_SUB_PATH
to/bot
Sure, will do
Set
DOMAIN_SUB_PATH
to/bot
Weird, doesn't seem to be working my side
Are images not loading? Or is there something else that's not working?
For reference, this is my nginx.conf I was using that worked:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8080;
server_name localhost;
location ^~ /bot/ {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
# by default nginx times out connections in one minute
proxy_read_timeout 1d;
}
}
include servers/*;
}
Yeah same problem as before.
Let me compare my nginx config with mine and test again shortly.
On 18 November 2024 23:13:57 SAST, Brendan Kellam @.***> wrote:
Are images not loading? Or is there something else that's not working?
For reference, this is my nginx.conf I was using that worked:
worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 8080; server_name localhost; location ^~ /bot/ { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Connection "upgrade"; proxy_set_header Upgrade $http_upgrade; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; # by default nginx times out connections in one minute proxy_read_timeout 1d; } } include servers/*; }
-- Reply to this email directly or view it on GitHub: https://github.com/sourcebot-dev/sourcebot/issues/61#issuecomment-2484142682 You are receiving this because you were mentioned.
Message ID: @.***>
Tristan B. Velloza Kildaire
Web: https://deavmi.assigned.network BNET IRC: deavmi Email: @.***
Are images not loading? Or is there something else that's not working?
For reference, this is my nginx.conf I was using that worked:
worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 8080; server_name localhost; location ^~ /bot/ { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Connection "upgrade"; proxy_set_header Upgrade $http_upgrade; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; # by default nginx times out connections in one minute proxy_read_timeout 1d; } } include servers/*; }
Trying it now, seems that CSS still doesn't load and neither images.
Actually trying now I get this:
That is with DOMAIN_SUB_PATH=/bot
and proxy_pass=http://sourcebot:3000
Could you share your nginx config? Also happy to hop on a call to diagnose if that would be easier. Our Discord :)
Could you share your nginx config? Also happy to hop on a call to diagnose if that would be easier. Our Discord :)
Here it is (I hope it is something glaringly obvious on my side):
Thanks - I will give this a try today
Thanks - I will give this a try today
Thank you! I don't know what I am doing wrong
Could you remove the trailing slash from proxy_pass
? I.e.:
proxy_pass http://sourcebot:3000;
I hit the same 404 issue as well when the trailing slash is included, but it worked when I removed it. I believe this part of the docs is relevant.
Could you remove the trailing slash from
proxy_pass
? I.e.:
proxy_pass http://sourcebot:3000;
I hit the same 404 issue as well when the trailing slash is included, but it worked when I removed it. I believe this part of the docs is relevant.
Hi, sure let me try
Could you remove the trailing slash from
proxy_pass
? I.e.:
proxy_pass http://sourcebot:3000;
I hit the same 404 issue as well when the trailing slash is included, but it worked when I removed it. I believe this part of the docs is relevant.
I have done so now, still same error. A 404.
Dang - tbh I don't know what else to try... would you be able to hop on a call sometime so we can try to diagnose synchronously?
Hi, I am currently trying to run this with an NGINX reverse proxy in front of it, but the URL paths are not playing nicely.
Any advice?