Coder.comC
Coder.comโ€ข14mo agoโ€ข
23 replies
Katorly

Need help configuring Coder WebSocket behind a proxy with non-standard ports

Sorry for the inconvenience I made. I don't have access to the standard ports (port 80 and port 443) on my cloud instance. ๐Ÿ˜ญ

I use Nginx to proxy coder from internal port 7080 to external port 1234.
Everything works perfectly fine, except for the logs session. Coder isn't showing any of the logs, including the workspace building logs and the template building logs.

As the image shows, my WebSocket connection had successfully established in the workspace health check page.

I checked my browser console, and there is always messages indicating that connection to WebSocket failed:
- WebSocket connection to 'wss://example.com:1234/api/v2/templateversions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/logs?follow=true' failed:
- Error: Connection for logs failed. at WebSocket.<anonymous>

There were no error logs in the coder container log:
2024-12-03 08:34:56.110 [info]  coderd: audit_log  ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  Time="2024-12-03T08:34:56.100751Z"  UserID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx  OrganizationID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx  Ip=172.xx.x.1  UserAgent=""  ResourceType=workspace_build  ResourceID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx  ResourceTarget=""  Action=stop  Diff="{}"  StatusCode=200  AdditionalFields="{\"workspace_name\":\"test1\",\"build_number\":\"2\",\"build_reason\":\"initiator\",\"workspace_owner\":\"\",\"workspace_id\":\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx\"}"  RequestID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx  ResourceIcon=""  actor="&{ID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx Email:redacted@example.com Username:somepeople}"
2024-12-03 08:35:18.526 [info]  coderd.workspace_usage_tracker: updated workspaces last_used_at  count=2  now="2024-12-03T08:35:17.869312391Z"
image.png
image.png
image.png
image.png
Was this page helpful?