Reverse proxy to MQTT broker over Websockets #2035
Unanswered
tukusejssirs
asked this question in
Q&A
Replies: 1 comment
-
Hi! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Related: #1670, #128, #1490
I want to reverse proxy to MQTT broker over Websockets using
nginx-proxy
in Docker container, but I can’t make it work.It works with
nginx
Docker container (aedes_ws
is another Docker container in which an MQTT broker running over Websockets on port8000
):I tried to add either of the following configs to
nginx-proxy
. I tried to put both configs to/etc/nginx/vhost.d/aedes_ws.conf
,/etc/nginx/conf.d/aedes_ws.conf
and/etc/nginx/proxy.conf
(of course, one config to one place at a time).I try to connect to it in Node.js using the following code:
However, it fails to connect via
nginx-proxy
, either that MQTT broker is offline (when config is in/etc/nginx/proxy.conf
or/etc/nginx/vhost.d/aedes_ws.conf
) withECONNREFUSED
error (connection refused; when config is in/etc/nginx/conf.d/aedes_ws.conf
).I use this env variables in
docker-compose
foraedes_ws
container:VIRTUAL_DEST: / VIRTUAL_HOST: localhost VIRTUAL_PATH: /api/mqtt # I also tried `/api/mqtt/` VIRTUAL_PORT: 8000
How can I make it work?
Thanks in advance for any help! 🙏
Beta Was this translation helpful? Give feedback.
All reactions