# Configuration of redirections · Reverse Proxy · Getting Started

Configure nginx to route requests to Gateway, Auth and Frontend, including WebSocket traffic and proxy headers.

Canonical: https://docs.mintsd.com/docs/mint-service-desk/getting-started-configuration-of-redirections
Language: en-GB
Revision: 2a2d39f1e31deba465d9905cd685a5a3416966a588eb6151bba19ba5bc3c7cc9

<a id="element-01a1452d-ec67-7b38-99db-9858907a7ee4"></a>

Configure routing in the `server` block of `nginx.conf`. The built-in reverse proxy has 4 `location` blocks:

<a id="element-01a1452d-ec68-7f3f-ace5-ec003ce70ed7"></a>

```default
location /api/ {
  proxy_pass http://gateway/api/;
  include common_location.conf;
}

location /livereloadHub {
  proxy_pass http://gateway/livereloadHub;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "Upgrade";
}

location ~* ^/(idp|connect|\.well-known|Account|external) {
  proxy_pass http://auth;
  include common_location.conf;
}

location / {
  proxy_pass http://frontend;
  include common_location.conf;
}
```

<a id="element-01a1452d-ec68-7692-ba40-59716726c17c"></a>

The first block routes requests under `https://domain.name/api/` to `Gateway`.

<a id="element-01a1452d-ec6a-7c99-b31d-b40ded7afdfe"></a>

The second block routes `https://domain.name/livereloadHub` to `Gateway` and enables WebSocket communication.

<a id="element-01a1452d-ec6a-733b-afd2-48194a14b71c"></a>

The third block routes requests to `Auth`, including the login page, OpenID Connect and static resources used by the login page.

<a id="element-01a1452d-ec6b-7a61-b782-1ba47e58d956"></a>

The last block routes all other requests to `Frontend`.

<a id="element-01a1452d-ec6c-7a77-92f8-25fb1c58bd7e"></a>

The `common_location.conf` file defines proxy headers, including `X-Forwarded-For`, `X-Forwarded-Proto`, `X-Forwarded-Host` and `X-Forwarded-Port`.

