RabbitMQ - add user, vhost and nginx proxy
November 7, 2017
Add user and vhost:
rabbitmqctl add_vhost /test
rabbitmqctl add_user test test
rabbitmqctl set_permissions -p /test test "^test-.*" ".*" ".*"
Nginx configuration for RabbitMQ Managment:
server {
listen 80;
server_name example.com;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/conf.d/.htpasswd_rabbit;
location / {
proxy_pass http://localhost: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;
}
}