Saturday, 14 June 2025

Route to Management Dashboard Locally for a RabbitMQ Cluster Deployed in AKS via Azure App Gateway and Nginx Ingress Controller

We have discussed "Setting Up RabbitMQ Cluster in AKS Using RabbitMQ Cluster Operator" and how to expose dashboard with "Access Management Dashboard Locally for a RabbitMQ Cluster Deployed in AKS via Port Forwarding or Nginx Ingress Controller Inside VNet". Using the same Nginx route we can setup app gateway route rule so that the RabbitMQ dashboard can be accessed public url.

The expectation  is to route via App Gateway as shown below..


The pathe based rule should be setup in App agteway as below using terraform.

path_rule {
  backend_address_pool_name  = "IngressAKS"
  backend_http_settings_name = "IngressAKS"
  name                       = "RabbitMQ"
  rewrite_rule_set_name      = "RabbitMQ"
  paths                      = ["/ch/demo/1.0/rabbitmq/*", ]
}

Then we can setup a rewrite rule as shown below using Nginx route we have implemented with private DNS zone in "Access Management Dashboard Locally for a RabbitMQ Cluster Deployed in AKS via Port Forwarding or Nginx Ingress Controller Inside VNet"

rewrite_rule_set {
    name = "RabbitMQ"

    rewrite_rule {
      name          = "RabbitMQDashboard"
      rule_sequence = 100
      condition {
        variable    = "var_uri_path"
        pattern     = "/ch/demo/1.0/rabbitmq/(.*)"
        ignore_case = true
      }
      request_header_configuration {
        header_name  = "Host"
        header_value = "rabbitmq-dashboard.aksblue.ch-mq-dev-eus-001.net"
      }
      url {
        components = "path_only"
        path       = "/{var_uri_path_1}"
        reroute    = false
      }
    }
  }

Since the public IP listener is setup and the public IP  of the App Gateway is added with a DNS name (ch-mq-dev-eus-001.eastus.cloudapp.azure.com), we can route to RabbitMQ dashboard, using url http://ch-mq-dev-eus-001.eastus.cloudapp.azure.com/ch/demo/1.0/rabbitmq/ .  The trailing / is important here. Withtout it the routing will not work.


No comments:

Popular Posts