RabbitMQ管理Nginx代理

时间:2013-01-16 09:41:21

标签: nginx rabbitmq

我有loadbalancer和vm与rabbitmq经纪人。在Rabbitmq上打开带有插件管理的5672端口,如果我创建了rabbitmq recive的代理

  
    

curl:(52)来自服务器的空回复

  

我可以通过telnet连接到rmq服务器并进行回调

  
    

卷曲:(56)Recv失败:由对等方重置连接

  

Nginx配置

server {
    listen    xxx.xxx.xxx.yy:80;
    server_name xxxxxxxxxx
    access_log acces.log;
    error_log error.log;
    location / {
            client_body_buffer_size 128k;
            proxy_send_timeout   90;
            proxy_read_timeout   90;
            proxy_buffer_size    4k;
            proxy_buffers     16 32k;
            proxy_busy_buffers_size 64k;
            proxy_temp_file_write_size 64k;
            proxy_connect_timeout 30s;
            proxy_pass   http://xxx.xxx.xxx.xx:5672;
            proxy_set_header   Host   $host;
            proxy_set_header   X-Real-IP  $remote_addr;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

1 个答案:

答案 0 :(得分:7)

哦,我错了管理插件的端口,它是15672,而不是5672.一切都很好

server {
    listen    xxx.xxx.xxx.yy:80;
    server_name xxxxxxxxxx
    access_log acces.log;
    error_log error.log;
    location / {
        client_body_buffer_size 128k;
        proxy_send_timeout   90;
        proxy_read_timeout   90;
        proxy_buffer_size    4k;
        proxy_buffers     16 32k;
        proxy_busy_buffers_size 64k;
        proxy_temp_file_write_size 64k;
        proxy_connect_timeout 30s;
        proxy_pass   http://xxx.xxx.xxx.xx:15672;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}