I’m using The AspNetCoreRateLimit package and
requests rate limit per times has been controlled but when change X-Real-IP in request then rate limit reset.
its part of my code:
"IpRateLimiting": {
"EnableEndpointRateLimiting": true,
"StackBlockedRequests": false,
"RealIpHeader": "X-Real-IP",
"ClientIdHeader": "X-ClientId",
"HttpStatusCode": 429,
"IpWhitelist": [ "127.0.0.1" ],
"EndpointWhitelist": [ "*:/assets/*" ],
"ClientWhitelist": [],
.
.
.
}
how can prevent this security issue?
2
Answers
in the settings of nginx in path
/etc/nginx/sites-enabled
in the Location section add this line:Your rules should be like below.
For more details, please read this article.