# Public approval surface. The service itself remains on JD loopback and this
# route is reached through a permitopen-restricted SSH tunnel.
location /authz/ {
    proxy_pass http://127.0.0.1:19221/;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    # Overwrite untrusted client input so application-level rate limits use the
    # address observed by this public edge, not a spoofed left-most value.
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Prefix /authz;
    proxy_connect_timeout 5s;
    proxy_read_timeout 30s;
    client_max_body_size 64k;
}
