Fetch requests to rabbitmq management ui fail from nodejs server

101 views
Skip to first unread message

oz-joe

unread,
Jan 3, 2022, 10:33:36 AM1/3/22
to rabbitmq-users
Fetch requests to my rabbitmq instance are failing in a nodejs server, but they work in the browser, with curl, and with postman. Initially they were only working if I sent the request from the rabbitmq dashboard itself. I saw in the docs of the management plugin that I have to configure cors headers using the management.cors.allow_origins option. I used the least restricted setting (management.cors.allow_origins.1 = *) and this allowed the requests to work in any browser tab provided the csp would allow it. But from my nodejs server it still doesn't work. Worth mentioning that the rabbitmq instance is currently not associated with a domain name, it's just the IP address i.e. something like http://12.34.56.78:15672. I don't know if the lack of ssl makes a difference. I've tried nodejs' http package, the equivalent https package, as well as a separate javascript request library, but it's the same outcome i.e. 404 not found. Again, using fetch in the browser has been working since I added the cors setting described above. The nodejs server is using express, for what it's worth. Any ideas as to what could be causing this? Thanks!

Wes Peng

unread,
Jan 3, 2022, 10:34:07 PM1/3/22
to rabbitm...@googlegroups.com
You should provide the application environment (versions, code piece, configuration etc) and logs (both server and clients).

Thanks.

On Mon, Jan 3, 2022 at 11:33 PM oz-joe <ucheoz...@gmail.com> wrote:
Fetch requests to my rabbitmq instance are failing in a nodejs server, but they work in the browser, with curl, and with postman. Initially they were only working if I sent the request from the rabbitmq dashboard itself. I saw in the docs of the management plugin that I have to configure cors headers using the management.cors.allow_origins option. I used the least restricted setting (management.cors.allow_origins.1 = *) and this allowed the requests to work in any browser tab provided the csp would allow it. But from my nodejs server it still doesn't work. Worth mentioning that the rabbitmq instance is currently not associated with a domain name, it's just the IP address i.e. something like http://12.34.56.78:15672. I don't know if the lack of ssl makes a difference. I've tried nodejs' http package, the equivalent https package, as well as a separate javascript request library, but it's the same outcome i.e. 404 not found. Again, using fetch in the browser has been working since I added the cors setting described above. The nodejs server is using express, for what it's worth. Any ideas as to what could be causing this? Thanks!

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/50d11763-2371-4f3b-9035-a260b6af5719n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages