> For the complete documentation index, see [llms.txt](https://docs.pullrequest.com/on-premise-server/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pullrequest.com/on-premise-server/advanced-proxy-configuration.md).

# Advanced Proxy Configuration

This page covers optional tuning settings not included in the setup walkthrough.

All configuration is done via environment variables in the `.env` file. After changing any value, restart the service:

```
systemctl restart pullrequest-proxy
```

### Repository Caching & Performance

| Variable           | Default | Description                                                                                                                                                                                                              |
| ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `NUM_REPO_WORKERS` | `5`     | Number of concurrent repository worker slots. Each worker can clone/process one repo at a time. Increase if reviews are queuing up because all workers are busy.                                                         |
| `REPO_CACHE_LIMIT` | `10`    | Maximum number of repos kept cached on disk after processing. Cached repos don't need re-cloning on subsequent reviews, which significantly speeds up repeated reviews for the same repo. Set to `0` to disable caching. |

**Disk space planning:** The proxy can hold up to `NUM_REPO_WORKERS + REPO_CACHE_LIMIT` repos on disk simultaneously (active + cached). When disk usage exceeds **80%**, the proxy automatically evicts the least-recently-used cached repos to free space.

With the default settings (5 workers + 10 cached), up to 15 repos may be on disk at once. Size your disk based on the average size of your repositories. The installation docs recommend **200 GB** as a starting point.

#### PII Anonymization

| Variable                  | Default | Description                                                                                                                                                    |
| ------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `PII_ANONYMIZATION_SALT`  | —       | Set to any secret string to enable PII anonymization. When enabled, personally identifiable information is hashed before being sent to the PullRequest server. |
| `PII_ANONYMIZE_USER_INFO` | `false` | Set to `true` to anonymize user info (usernames, display names, emails). Requires `PII_ANONYMIZATION_SALT` to be set.                                          |

#### HTTP Proxy

Standard UNIX proxy environment variables are supported for routing outbound traffic through a corporate proxy:

| Variable                      | Description                                        |
| ----------------------------- | -------------------------------------------------- |
| `http_proxy` / `HTTP_PROXY`   | Proxy URL for HTTP traffic.                        |
| `https_proxy` / `HTTPS_PROXY` | Proxy URL for HTTPS traffic.                       |
| `no_proxy` / `NO_PROXY`       | Comma-separated list of hosts to bypass the proxy. |

### Complete `.env` Variable Reference

For convenience, here is every supported variable. Variables marked with \* are covered in the setup walkthrough.

| Variable                      | Default                       | Required | Setup Step                                                                                                |
| ----------------------------- | ----------------------------- | -------- | --------------------------------------------------------------------------------------------------------- |
| `PULLREQUEST_TOKEN`           | —                             | Yes      | [Connecting Proxy](https://docs.pullrequest.com/on-premise-server/connecting-your-proxy-with-pullrequest) |
| `PULLREQUEST_SECRET`          | —                             | Yes      | [Connecting Proxy](https://docs.pullrequest.com/on-premise-server/connecting-your-proxy-with-pullrequest) |
| `PULLREQUEST_BASE_URL`        | `https://app.pullrequest.com` | No       | —                                                                                                         |
| `PROVIDER_TYPE`               | —                             | Yes      | [Configure Posting User](https://docs.pullrequest.com/on-premise-server/configure-posting-user)           |
| `PROVIDER_BASE_URL`           | —                             | Yes      | [Configure Posting User](https://docs.pullrequest.com/on-premise-server/configure-posting-user)           |
| `PROVIDER_USERNAME`           | —                             | Yes      | [Configure Posting User](https://docs.pullrequest.com/on-premise-server/configure-posting-user)           |
| `PROVIDER_ACCESS_TOKEN`       | —                             | Yes      | [Configure Posting User](https://docs.pullrequest.com/on-premise-server/configure-posting-user)           |
| `PROVIDER_WEBHOOK_SECRET`     | —                             | No       | [Configure Webhooks](https://docs.pullrequest.com/on-premise-server/configure-webhooks)                   |
| `USE_TLS`                     | `false`                       | No       | [Configuring SSL](https://docs.pullrequest.com/on-premise-server/configuring-ssl)                         |
| `TLS_CERT_PATH`               | —                             | If TLS   | [Configuring SSL](https://docs.pullrequest.com/on-premise-server/configuring-ssl)                         |
| `TLS_KEY_PATH`                | —                             | If TLS   | [Configuring SSL](https://docs.pullrequest.com/on-premise-server/configuring-ssl)                         |
| `DEBUG`                       | `false`                       | No       | —                                                                                                         |
| `SERVER_PORT`                 | `5012`                        | No       | —                                                                                                         |
| `NUM_REPO_WORKERS`            | `5`                           | No       | This page                                                                                                 |
| `REPO_CACHE_LIMIT`            | `10`                          | No       | This page                                                                                                 |
| `PII_ANONYMIZATION_SALT`      | —                             | No       | This page                                                                                                 |
| `PII_ANONYMIZE_USER_INFO`     | `false`                       | No       | This page                                                                                                 |
| `http_proxy` / `HTTP_PROXY`   | —                             | No       | [Installing Proxy](https://docs.pullrequest.com/on-premise-server/installing-the-pullrequest-proxy)       |
| `https_proxy` / `HTTPS_PROXY` | —                             | No       | [Installing Proxy](https://docs.pullrequest.com/on-premise-server/installing-the-pullrequest-proxy)       |
| `no_proxy` / `NO_PROXY`       | —                             | No       | [Installing Proxy](https://docs.pullrequest.com/on-premise-server/installing-the-pullrequest-proxy)       |
