docs/en/docs/rules/forwardedFor.md
Modify the x-forwarded-for request header field to customize the client IP address.
pattern forwardedFor://ip [filters...]
| Parameters | Description | Detailed Documentation |
|---|---|---|
| pattern | Expression to match request URLs | Match Pattern Documentation |
| ip | Custom client IP | |
| ⚠️ Loading data from files/remote URLs is not supported | ||
| filters | Optional filters, supports matching: | |
| • Request URL/Method/Headers/Content | ||
| • Response Status Code/Headers | Filter Documentation |
# Setting a fixed IP address
www.example.com/path forwardedFor://1.1.1.1
# Using the real client IP address (transparent mode)
www.example.com forwardedFor://`${clientIp}`
value in this method is not limited to the IP address)x-forwarded-for: enable://clientIp