<div dir="ltr"><div>I am trying to setup rabbitmq it can be accessed externally (from non-localhost) through nginx.</div><div><br></div><div>nginx-rabbitmq.conf:</div><div><br></div><div>server {</div><div>    listen       5672;</div><div>    server_name  x.x.x.x;</div><div>    location / {</div><div>        proxy_pass http://localhost:55672/;</div><div>    }</div><div>}</div><div><br></div><div>rabbitmq.conf:</div><div><br></div><div>[</div><div> {rabbit,</div><div>  [</div><div>   {tcp_listeners, [{"127.0.0.1", 55672}]}</div><div>  ]</div><div> }</div><div>]</div><div><br></div><div><br></div><div>By default guest user can only interact from localhost, so we need to create another user with required permissions, like so:</div><div><br></div><div>sudo rabbitmqctl add_user my_user my_password</div><div>sudo rabbitmqctl set_permissions my_user ".*" ".*" ".*"</div><div><br></div><div>However, when I attempt a connection to rabbitmq through pika I get ConnectionClosed exception</div><div><br></div><div>import pika</div><div>credentials = pika.credentials.PlainCredentials('my_username', 'my_password')</div><div>pika.BlockingConnection(</div><div>    pika.ConnectionParameters(host=ip_address, port=55672, credentials=credentials)</div><div>)</div><div><br></div><div>However, if I use the same credentials via localhost and change to port 5672 then it connects ok:</div><div><br></div><div>I have opened port 5672 on the GCE web console, and communication through nginx is happening: nginx access.log file shows</div><div><br></div><div>[30/Apr/2014:22:59:41 +0000] "AMQP\x00\x00\x09\x01" 400 172 "-" "-" "-"</div><div><br></div><div>Which shows a 400 status code response (bad request).</div><div><br></div><div>So by the looks the request fails when going through nginx, but works when we request rabbitmq directly.</div><div><br></div><div>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?</div></div>