RabbitMQ connection error: "Frame size exceeds frame max"

Hi!

I am trying to publish a message to a RabbitMQ that is running in docker in a different server than n8n’s. I get the following error message when I execute the workflow:

Problem executing workflow
There was a problem executing the workflow:
“Frame size exceeds frame max”

image

My RabbitMQ is running in docker behind an nginx reverse proxy. The reverse proxy configuration in nginx is set to redirect any incoming request from mydomain.com to port 5672, the port wich my docker container is exposed:

server {
server_name rmq.mydomain.com;
location / {

proxy_pass http://127.0.0.1:5672;
proxy_set_header Connection ‘’;
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
}

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/rmq.mydomain.comfullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/rmq.mydomain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
if ($host = rmq.mydomain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot

server_name rmq.mydomain.com;
listen 80;
return 404; # managed by Certbot

}

Tests I did so far:

1- In my rabbit credentials, I set the configuration port to 443 (because of the reverse proxy), but when I use 443 port or 80 I get the error message shown previously.
If I set the port to the standard 5672 I get a timeout, obviously, because my nginx is not listening to that port directly; it is actually listening to 80 and 443 port and redirecting it to the rabbit docker container’s internal 5672 exposed port.

This is my RabbitMQ credential configuration:

2- Tried from a different server behind an AWS load balancer, (NOT nginx), with docker as well and I’m having the same issue as with nginx (exact same error message).

3-Tried using a cloudamqp.com pre configured account, and the workflow worked correctly. I have also created a new server from scratch with RabbitMQ (not dockerized, and not behind any type of reverse proxy), and worked well with the standard port 5672.

The issue seems to be with the reverse proxy somehow. What I am missing here?

Thanks for your help.

Hey @pbdco, as mentioned in your other topic I’ll set up a RabbitMQ test server in the next days to give this tool a closer look.

Based on your description it does indeed seem like a problem with the reverse proxy in front of your RabbitMQ instance, so I am not sure if there’s much you could do from the n8n side of things here so far (but again, I know roughly nothing about RabbitMQ as of yet).

A quick look at this thread on stack overflow suggests there might be protocol mismatch:

So you might want to verify the approaches described in there check or double-check in a RabbitMQ-specific community how to best configure an nginx reverse proxy for use with RabbitMQ.

1 Like

For anyone out there with this issue, I ended up using this server block for my NGINX reverse proxy configuration (using Docker):

server {
server_name rmq.mydomain.com;

location /rabbitmq/api/queues/ {
    proxy_pass http://127.0.0.1:5672/api/queues/%2F/;
}
location /rabbitmq/api/exchanges/ {
    proxy_pass http://127.0.0.1:5672/api/exchanges/%2F/;
}
location /rabbitmq/ {
    proxy_pass http://127.0.0.1:5672/;
}
}

Useful links:

Thanks @MutedJam !

1 Like