DevelopmentJuly 1, 2026· via DEV Community

Nginx Fixes RabbitMQ UI Glitch: Keep Slashes Intact

Nginx Fixes RabbitMQ UI Glitch: Keep Slashes Intact

Image : DEV Community

When RabbitMQ’s Management UI is tucked behind an Nginx reverse proxy under a sub-path like /rabbitmq/, queues and API calls can vanish without warning. The culprit is Nginx’s habit of decoding %2F—the URL-encoded slash—into a literal slash before the request reaches RabbitMQ. Because RabbitMQ’s Management API uses %2F to denote the default virtual host, the decoded slash turns /api/queues/%2F/my-queue into /api/queues///my-queue, leaving endpoints unusable.

Why Common Workarounds Fail

Many guides suggest turning off merge_slashes or rewriting paths, but those tweaks don’t stop Nginx from normalizing the URI before forwarding it. Even a rewrite rule can’t preserve the original %2F once Nginx rewrites $uri.

The One-Line Solution

Nginx’s $request_uri variable stores the raw, undecoded request exactly as the client sent it. By using $request_uri in an if block, you bypass Nginx’s normalization entirely. For API paths, match the raw URI and pass it directly to RabbitMQ without decoding. For static assets and non-API pages, a simple rewrite rule suffices. The configuration keeps slashes intact, restores queue pages, and prevents silent API failures under sub-path routing.


Source: DEV Community. AI-assisted editorial synthesis — TechnoExpress.

Read the original source on DEV Community →

← Back to home