Thank you to all the people building the future with us.

Read More

Web dispatch plugin

The rabbitmq-web-dispatch plugin provides hosting for other plugins that have HTTP interfaces. It allows these interfaces to co-exist on one or more HTTP listeners.


Plugins using rabbitmq-web-dispatch typically take a listener configuration item to configure their listening HTTP port. In this page we will give examples for the rabbitmq_management application, but the same configuration can be applied to rabbitmq_jsonrpc and rabbitmq_web_stomp_examples.

The listener configuration item can contain the following keys:

  • port (mandatory)
  • ip (to listen on only one interface)
  • ssl (to enable SSL)
  • ssl_opts (to configure SSL)
  • cowboy_opts (to configure the Cowboy HTTP server)

Listening on a single interface

Use ip to specify an interface for Cowboy to bind to (giving an IP address as a string or tuple). For example:

management.listener.port = 15672
management.listener.ip   =

Or, using the classic config format:

  [{listener, [{port, 15672},
               {ip, ""}


Set ssl to true to turn on TLS for a listener. Use ssl_opts to specify SSL options. These are the standard Erlang TLS options: see the RabbitMQ TLS guide for more information.

For convenience, if you do not specify ssl_opts then Web Dispatch will use the same options as the main RabbitMQ server does for AMQP over TLS, but with client certificate verification turned off. If you wish to use client certificate verification, specify ssl_opts explicitly.

For example:

management.listener.port = 15672
management.listener.ssl  = true

management.listener.ssl_opts.cacertfile = /path/to/cacert.pem
management.listener.ssl_opts.certfile   = /path/to/cert.pem
management.listener.ssl_opts.keyfile    = /path/to/key.pem

The same example using the classic config format:

  [{listener, [{port,     15672},
               {ssl,      true},
               {ssl_opts, [{cacertfile, "/path/to/cacert.pem"},
                           {certfile,   "/path/to/cert.pem"},
                           {keyfile,    "/path/to/key.pem"}]}

Compressed responses

Cowboy provides a number of options that can be used to customize the behavior of the server. You can specify those in the listener options under cowboy_opts.

To compress responses, set the proper cowboy_opts option:

  [{listener, [{port,        15672},
               {cowboy_opts, [{compress, true}]}

Getting Help and Providing Feedback

If you have questions about the contents of this guide or any other topic related to RabbitMQ, don't hesitate to ask them on the RabbitMQ mailing list.

Documentation feedback is also very welcome on the list. If you'd like to contribute an improvement to the site, its source is available on GitHub.