第一种:
直接加个location块
location /rabbitmq/ { proxy_pass http://127.0.0.1:15672/; }
第二种:
location /rabbitmq/ { port_in_redirect on; proxy_redirect off; proxy_pass http://localhost:15672/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header User-Agent $http_user_agent; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; rewrite ^/rabbitmq/(.*)$ /$1 break; }