# Configure nginx

The website uses nginx as a reverse proxy. This means that requests from the Internet are served by nginx, which forwards them to Django, and then returns the response to the user.

## Config file location

Dokku places a single config file into the main nginx config directory at `/etc/nginx/conf.d/dokku.conf`.

That file loads individual config files for each dokku app.

The nginx configuration used for the website is stored at  `/home/dokku/APP/nginx.conf`.

## Additional config files

The app's main nginx configuration file dynamically includes the files  `/home/dokku/APP/nginx.conf.d/*.conf` .  These files are included as part of the `server` nginx configuration block.&#x20;

You can put additional files into this directory to customise the nginx configuration. Once you have added a file or made changes, you must tell nginx to reload its configuration.

First, ask nginx to test that the configuration is valid:

```
sudo service nginx configtest
```

If that shows an error, look at the log output in `/var/log/nginx/error.log` for more details.

If nginx is happy with the changes, tell it to re-load its configuration:

```
sudo service nginx reload
```

## Further reading

See Dokku's documentation on [Nginx Proxy Configuration](https://dokku.com/docs/networking/proxies/nginx/) for more details.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://liieditors.docs.laws.africa/system-management/configure-nginx.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
