[rabbitmq-discuss] rabbitmq behind nginx

Simon MacMullen simon at rabbitmq.com
Thu May 1 08:33:31 BST 2014


Port 5672 is AMQP. Port 55672 is the old HTTP management plugin port. 
(It's moved to port 15672.)

nginx can't proxy AMQP.

So are you trying to proxy AMQP or HTTP? If you are just trying to 
access RabbitMQ from non-localhost, why do you need nginx?

For default log file locations it depends how you installed RabbitMQ, 
see http://www.rabbitmq.com/relocate.html for the various possibilities.

Cheers, Simon

On 01/05/2014 00:13, Richard Tier wrote:
> I am trying to setup rabbitmq it can be accessed externally (from
> non-localhost) through nginx.
>
> nginx-rabbitmq.conf:
>
> server {
>      listen       5672;
>      server_name  x.x.x.x;
>      location / {
>          proxy_pass http://localhost:55672/;
>      }
> }
>
> rabbitmq.conf:
>
> [
>   {rabbit,
>    [
>     {tcp_listeners, [{"127.0.0.1", 55672}]}
>    ]
>   }
> ]
>
>
> By default guest user can only interact from localhost, so we need to
> create another user with required permissions, like so:
>
> sudo rabbitmqctl add_user my_user my_password
> sudo rabbitmqctl set_permissions my_user ".*" ".*" ".*"
>
> However, when I attempt a connection to rabbitmq through pika I get
> ConnectionClosed exception
>
> import pika
> credentials = pika.credentials.PlainCredentials('my_username',
> 'my_password')
> pika.BlockingConnection(
>      pika.ConnectionParameters(host=ip_address, port=55672,
> credentials=credentials)
> )
>
> However, if I use the same credentials via localhost and change to port
> 5672 then it connects ok:
>
> I have opened port 5672 on the GCE web console, and communication
> through nginx is happening: nginx access.log file shows
>
> [30/Apr/2014:22:59:41 +0000] "AMQP\x00\x00\x09\x01" 400 172 "-" "-" "-"
>
> Which shows a 400 status code response (bad request).
>
> So by the looks the request fails when going through nginx, but works
> when we request rabbitmq directly.
>
> Has anyone else had similar problems/got rabbitmq working for external
> users through nginx? is there a rabbitmq log file where I can see each
> request and help further troubleshooting?
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>



More information about the rabbitmq-discuss mailing list