# Configuring the reverse proxy · Reverse proxy on the host machine · Reverse Proxy · Getting Started

Configure nginx on the host using the Docker gateway address and the ports exposed by each service.

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

<a id="element-01a1452d-ec96-7618-8174-1d3147cc98a8"></a>

This example uses `nginx` as the HTTP reverse proxy on the host. Start with the configuration used by the built-in `Reverse Proxy` service.

<a id="element-01a1452d-ec97-7e99-9b51-a5c08ab68810"></a>

Docker Swarm uses an overlay network. Services on that network are not accessible at `localhost`. Use `ip addr` to find the address used to access the stack.

<a id="element-01a1452d-ec98-7954-8060-01dbc47c3f4b"></a>

Example output:

<a id="element-01a1452d-eca3-7dfc-be20-db97f71ec6ea"></a>

```default
...
5: docker_gwbridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:98:4e:fe:bc brd ff:ff:ff:ff:ff:ff
    inet 172.21.0.1/16 brd 172.21.255.255 scope global docker_gwbridge
       valid_lft forever preferred_lft forever
    inet6 fe80::42:98ff:fe4e:febc/64 scope link
       valid_lft forever preferred_lft forever
...
```

<a id="element-01a1452d-eca4-751b-9315-d604058340de"></a>

Use the address assigned to `docker_gwbridge` when configuring the reverse proxy. The address given in this example is `127.21.0.1`.

<a id="element-01a1452d-eca6-7db9-82ce-52dbeb829adb"></a>

In `nginx.conf`, replace the built-in `Reverse Proxy` destination addresses. For example, replace `http://gateway` with `http://ip_address_docker_gwbridge:the_port_where_the_service_was_exposed`. Update the other location blocks in the same way.

