页面操作:add queue 报错:Got response code 405 with body {"error":"Method Not Allowed","reason":""Method Not Allowed"\n"}
原因:
正常访问该地址:https://xxx.xxx.com/mq/ 时能正常跳转,
但是 rabbitmq management 的 API url 出现了 %2f 字符,这些字符会在经过 nginx 被转换为/
加
if ($request_uri ~* "/rabbitmq/(.*)"){
proxy_pass http://127.0.0.1:15672/$1;
break;
}
location /rabbitmq/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
if ($request_uri ~* "/rabbitmq/(.*)"){
proxy_pass http://127.0.0.1:15672/$1;
break;
}
proxy_pass http://rabbitmq:15672/;
}
网友评论