You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use this command to connect nats directly, I got the right output:
root@OpenWrt:/etc/nginx/conf.d# nats --server ws://nats.example.com:9222/ws --token xxx kv get mybuget mykey
mybuget > mykey revision: 4 created @ 2025-09-30 10:11:18
xxxx
But if I use this command to connect nats through nginx, I got error:
root@OpenWrt:/etc/nginx/conf.d# nats --server wss://nats.example.com/ws --token xxx kv get mybuget mykey
nats: error: nats: no servers available for connection
Am I missing something, or does NATS not currently support running websockets behind a reverse proxy? I would be very grateful for any help I could get!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I'm just trying to deply nats behind nginx, this is my nats config:
And this is my nginx config:
When I use this command to connect nats directly, I got the right output:
root@OpenWrt:/etc/nginx/conf.d# nats --server ws://nats.example.com:9222/ws --token xxx kv get mybuget mykey mybuget > mykey revision: 4 created @ 2025-09-30 10:11:18 xxxx
But if I use this command to connect nats through nginx, I got error:
Am I missing something, or does NATS not currently support running websockets behind a reverse proxy? I would be very grateful for any help I could get!
Beta Was this translation helpful? Give feedback.
All reactions