---
title: Webserver URL, Reverse Proxy, and Forward Proxy Setup
description: Configure the Kestra webserver URL and proxy settings to ensure correct link generation and access behind reverse proxies.
url: https://kestra.io/docs/administrator-guide/webserver-url
---

# Set the webserver base URL and configure forward/reverse proxies

The `kestra.url` property sets the base URL for the Kestra webserver. Notification services use it to generate links in alert messages, and tasks that call the Kestra API from a worker (for example `io.kestra.plugin.git.NamespaceSync` or `io.kestra.plugin.kestra.*` tasks) use it as the default API address. The value must be a full URI with a trailing `/`, excluding `ui` or `api`.

```yaml
kestra:
  url: https://www.my-host.com/kestra/
```

Use the address users and workers actually reach: the HTTPS address when TLS is terminated by a reverse proxy or by Kestra itself. Set it on every Kestra component, including workers that run on separate hosts.

## Proxy configuration

In networking, a **forward proxy** acts on behalf of clients to control **outbound traffic**, while a **reverse proxy** acts on behalf of servers to control **inbound traffic** and may also provide features such as load balancing and SSL encryption.

A forward proxy serves as an intermediary for requests from clients seeking resources from other servers (such as the Kestra API for retrieving blueprints and plugin documentation), while a reverse proxy sits in front of one or more web servers, intercepting client requests before they reach the server.

### Forward proxy configuration

In a forward proxy, the client connects to the proxy server, requesting some service (such as Kestra API) available from a different server.

The `micronaut.http.services.api` configuration accepts a proxy address, username, and password. This routes Kestra API requests (used to fetch Blueprints and plugin documentation for the UI) through the proxy:

```yaml
micronaut:
  http:
    services:
      api:
        url: https://api.kestra.io
        proxy-type: http
        proxy-address: my.company.proxy.address:port
        proxy-username: "username"
        proxy-password: "password"
        follow-redirects: true
```

See the [Micronaut HttpClient Configuration](https://docs.micronaut.io/latest/guide/configurationreference.html#io.micronaut.http.client.DefaultHttpClientConfiguration) for more details on configuring `DefaultHttpClientConfiguration` in your `config.yml` file.

Another way to authenticate is by providing `micronaut.http.client.proxy-authorization: Basic <base64-encoded username:password>` and `micronaut.http.services.*.proxy-authorization: Basic <base64-encoded username:password>`, which prevents the password from being displayed in plain text in the config file.

This configuration only covers requests made by Kestra itself, such as fetching Blueprints. To send HTTP tasks through the same proxy, see [HTTP tasks behind a forward proxy](https://kestra.io/docs/configuration/plugins-and-execution#http-tasks-behind-a-forward-proxy).

### Reverse proxy configuration

Reverse proxies hide the server’s identity from clients and may perform tasks such as load balancing, authentication, decryption, and caching. A reverse proxy acts on behalf of the server, taking requests from the external network, and directing them to the internal server(s) that can fulfill those requests.

To display executions in real-time when hosting Kestra behind a reverse proxy, enable [Server-sent events (SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).

On some reverse proxies, such as Nginx, you need to disable buffering to enable real-time updates.

The following Nginx `location` block streams SSE without buffering and accepts uploads up to 16 MB:

```bash
location / {
    proxy_pass  http://localhost:<kestra_port>;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_read_timeout 600s;
    proxy_redirect    off;
    proxy_set_header  Host             $http_host;
    proxy_set_header  X-Real-IP        $remote_addr;
    proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
    proxy_set_header  X-Forwarded-Protocol $scheme;

    # File inputs and uploads: Nginx rejects request bodies above 1 MB by default
    client_max_body_size 16m;

    # Needed for SSE
    proxy_buffering off;
    proxy_cache off;
}
```

Raise `client_max_body_size` if users upload larger file inputs or namespace files. Kestra itself accepts request bodies up to `micronaut.server.max-request-size` (10 GB by default), see [Webserver](https://kestra.io/docs/architecture/server-components/webserver).

To access Kestra via a separate context path, add the following to your Kestra startup configuration (for example, to serve the UI at `mycompany.com/kestra`):

```yaml
micronaut:
  server:
    context-path: "/kestra"
```

Then, modify your above nginx configuration to the following

```bash
server {
    listen 80;
    server_name mycompany.com;

    location /kestra {
        proxy_pass  http://<kestra-hostname>:<kestra-port>/kestra;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 600s;
        proxy_redirect    off;
        proxy_set_header  Host             $http_host;
        proxy_set_header  X-Real-IP        $remote_addr;
        proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_set_header  X-Forwarded-Protocol $scheme;

        client_max_body_size 16m;

        # Needed for SSE
        proxy_buffering off;
        proxy_cache off;
    }
}
```