> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# nginx-proxy-pass-request-host

> An Nginx proxy_pass takes its upstream host from a client-sent value such as $http_host or a query argument.

## What it flags

An Nginx `proxy_pass` whose upstream host is a variable the client controls: `$host`, `$http_host`, any other `$http_*` header, `$arg_*` query arguments or `$cookie_*` values, with or without a scheme (`proxy_pass $scheme://$http_x_forwarded_host`, `proxy_pass $arg_url`). A numbered capture of a regex `location` that forms the whole host (`location ~ ^/go/(.+)$ { proxy_pass https://$1; }`) counts too, because it holds part of the request path. The client can then make Nginx forward requests to internal services or arbitrary hosts. [OWASP: SSRF](https://owasp.org/www-community/attacks/Server_Side_Request_Forgery)

Variables in the path only (`proxy_pass http://backend$request_uri`) and `proxy_set_header Host $host` are not reported. A `$host` or `$http_host` upstream in a server block that lists only literal `server_name` values and is not marked `default_server` is reported as contextual, because Nginx routes only matching Host values there unless the block is the default server for its port.

```nginx theme={null}
location /api/ {
  proxy_pass http://api_upstream;
  proxy_set_header Host $host;
}
```

No automatic fix: a human decides.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "nginx-proxy-pass-request-host": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.