# HTTP Path Rewrites in Redpanda Console

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [streaming-full.txt](https://docs.redpanda.com/streaming-full.txt)

---
title: HTTP Path Rewrites in Redpanda Console
latest-redpanda-tag: v26.1.9
latest-console-tag: v3.7.3
latest-operator-version: v26.1.4
# EOL = End-of-Life (support lifecycle status)
page-is-nearing-eol: "false"
page-is-past-eol: "false"
page-eol-date: March 31, 2027
latest-connect-version: 4.93.0
docname: config/http-path-rewrites
page-component-name: streaming
page-version: "26.1"
page-component-version: "26.1"
page-component-title: Streaming
page-relative-src-path: config/http-path-rewrites.adoc
page-edit-url: https://github.com/redpanda-data/docs/edit/main/modules/console/pages/config/http-path-rewrites.adoc
description: Learn how to configure Redpanda Console to work with your URL path rewrites, particularly when hosted under a subpath.
page-git-created-date: "2024-09-11"
page-git-modified-date: "2026-05-26"
support-status: supported
---

<!-- Source: https://docs.redpanda.com/streaming/current/console/config/http-path-rewrites.md -->

If you want to host Redpanda Console under a subpath rather than the root path, you need to configure HTTP path rewrites. This allows you to serve Redpanda Console under a subpath of your domain, such as `https://my-company.com/redpanda/console`, instead of directly from `https://my-company.com`. This type of configuration is often necessary when:

-   You have multiple services and applications running under the same domain.

-   Redpanda Console is behind a reverse proxy. The proxy might add a path prefix based on routing rules, and Redpanda Console needs to know about this prefix to handle requests correctly.


> 📝 **NOTE**
>
> If you host Redpanda Console at a root path, for example under a sub-domain such as `https://console.redpanda.my-company.com`, you don’t need to configure HTTP path rewrites.

## [](#configuration)Configuration

To configure HTTP path rewrites, set the following properties within the `server` object in your Redpanda Console configuration file:

| Configuration | Description | Default |
| --- | --- | --- |
| basePath | The subpath under which Redpanda Console is hosted.If you have a proxy in front of Redpanda Console that sets the X-Forwarded-Prefix header and setBasePathFromXForwardedPrefix is enabled, you do not need to set basePath manually.See Custom subpath scenario. | '' |
| setBasePathFromXForwardedPrefix | Tells Redpanda Console to use the X-Forwarded-Prefix header on incoming requests for determining the path prefix.If this header is present, its value will be used as the path prefix, and the value set in basePath will be ignored.See Custom subpath scenario. | true |
| stripPrefix | Removes the specified prefix from the request path before routing it to Redpanda Console.If your proxy is configured to remove the prefix, you should disable stripPrefix in Redpanda Console.See Prefix removal scenario. | true |

## [](#custom-subpath-scenario)Custom subpath scenario

Consider the following setup where you want to host Redpanda Console at `https://my-company.com/redpanda/console/` and are using a reverse proxy to manage the routing:

1.  Nginx is configured to route requests from `/redpanda/console` to Redpanda Console, running on `http://localhost:8080`.

    ### Standalone

    Nginx configuration

    ```nginx
    location /redpanda/console/ {
        proxy_pass http://localhost:8080/;
        proxy_set_header X-Forwarded-Prefix /redpanda/console;
    }
    ```


    ### Kubernetes

    ```yaml
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: redpanda-console
      annotations:
        # Pass the base-path header through to Redpanda Console
        nginx.ingress.kubernetes.io/configuration-snippet: |
          proxy_set_header X-Forwarded-Prefix /redpanda/console;
    spec:
      ingressClassName: nginx # or your ingress class name
      tls:
        - hosts:
            - my-company.com
          secretName: my-company-tls # optional
      rules:
        - host: my-company.com
          http:
            paths:
              - path: /redpanda/console
                pathType: Prefix
                backend:
                  service:
                    name: redpanda-console        # your Service name
                    port:
                      number: 8080                 # your Service port
    ```

2.  Redpanda Console is configured to use the `X-Forwarded-Prefix` header for determining the base path.

    ### Standalone

    ```yaml
    server:
      setBasePathFromXForwardedPrefix: true
      stripPrefix: true
    ```


    ### Kubernetes embedded

    When Redpanda Console is part of the Redpanda Helm chart or Operator:
    #### Operator

    ```yaml
    apiVersion: cluster.redpanda.com/v1alpha2
    kind: Console
    metadata:
      name: redpanda-console
    spec:
      clusterRef:
        name: redpanda
      config:
        server:
          setBasePathFromXForwardedPrefix: true
          stripPrefix: true
    ```


    #### Helm

    ```yaml
    console:
      enabled: true
      console:
        config:
          server:
            setBasePathFromXForwardedPrefix: true
            stripPrefix: true
    ```

    ### Kubernetes standalone

    When using the standalone Redpanda Console Helm chart:

    ```yaml
    config:
      server:
        setBasePathFromXForwardedPrefix: true
        stripPrefix: true
    ```

3.  A user navigates to `https://my-company.com/redpanda/console/topics` in their browser.

4.  Nginx receives the request and recognizes the `/redpanda/console` subpath. It forwards the request to Redpanda Console at `http://localhost:8080/topics`, while adding the `X-Forwarded-Prefix: /redpanda/console` header.

5.  Because `setBasePathFromXForwardedPrefix` is set to `true`, Redpanda Console checks the `X-Forwarded-Prefix` header. It identifies that the base path is `/redpanda/console` and removes this prefix from the incoming request path. The request path `/topics` is now correctly routed in Redpanda Console.


If Nginx were configured without the `X-Forwarded-Prefix` header, or if `setBasePathFromXForwardedPrefix` was set to `false`, Redpanda Console would not correctly recognize the subpath, leading to routing issues. This configuration is particularly useful when multiple environments or proxies might route to the same Redpanda Console instance under different subpaths.

## [](#prefix-removal-scenario)Prefix removal scenario

Some proxies, such as Traefik, can remove a prefix from the URL path before forwarding it. If both the proxy and Redpanda Console attempt to remove the prefix, Redpanda Console may fail to route the request correctly. Only one part of the stack (either the proxy or Redpanda Console) should remove the prefix.

To better understand this problem, consider the following scenario:

1.  Traefik is configured to route `/topics` to Redpanda Console with the "StripPrefix" middleware enabled.

2.  Redpanda Console is configured with the default settings, which includes `stripPrefix: true`.

3.  A user enters the following address in their browser: `example.com/topics/topics/example-topic`.

4.  Traefik removes the first `/topics` from the path, leaving `/topics/example-topic`, and sets `/topics` in the `X-Forwarded-Prefix` header.

5.  Redpanda Console sees the `X-Forwarded-Prefix` and attempts to remove what it thinks is the prefix. The path becomes `/example-topic`.

6.  Redpanda Console then tries to find a handler for `/example-topic`, but no such route exists, leading to a failure.


To avoid this issue, either disable `stripPrefix` in Redpanda Console or ensure that the proxy does not modify the request path in a conflicting manner.

## [](#proxy-rewrites)Proxy rewrites

If you have a reverse proxy between Redpanda Console and Kafka Connect, ensure that any rewrite rules retain the necessary expand parameters in the query string. These parameters are crucial for Kafka Connect to return the correct details about the connectors:

`://<kafka_connect_host>:8083/connectors?expand=info&expand=status`

This ensures that Redpanda Console can correctly communicate with Kafka Connect even when hosted behind a proxy that rewrites URLs.