-1
votes
1answer
23 views

nginx rate limitinf unknown directive

I'm trying to set up a rate limit for bots using my website, but if i add limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; or anything of the sort to /etc/nginx/nginx.conf in the http ...
0
votes
1answer
545 views

Nginx $http_x_forwarded_for not always being set

I've noticed in our access logs that sometimes, the $http_x_forwarded_for variable has not been set, and instead, the correct IP is the one set to $remote_addr. Is it possible to set ...
1
vote
1answer
124 views

nginx 301'ing limit_req rate limited requests instead of error page

I have a bulk search form on apache servers behind nginx. I'd like to protect that location so that the second request in a 10 minute period gets 301'd to a "Would you like to use our API" page ...
0
votes
0answers
70 views

Limit concurrent connections in nginx across multiple servers

I am running a download service with free and paid premium membership types. The free membership should be restricted to one concurrent download. I know how to accomplish this when only one server ...
1
vote
0answers
83 views

nginx and cloudlfare ip confusion?

I am using the below config in http block of my nginx.conf to get real ip while using Cloudflare acceleration service: ## Cloudflare settings to get Real IP's set_real_ip_from ...
0
votes
2answers
182 views

How to prevent nginx throttling conflicting with maintenance mode?

We use the HttpLimitReqModule nginx mondule for rate throttling and have found that it conflicts with our "maintenance mode" because both components are using http status code 503. When throttling is ...
-1
votes
2answers
153 views

Nginx Rate Limiting by Referrer?

I've successfully set up rate limiting on IP addresses like so, limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; But I was wondering if its possible to do the same on referrers? For ...
0
votes
2answers
429 views

Dynamic throttling of bandwidth

I am planning on setting up streaming server. Streaming is done kind of like YT does it; there will be a large number of audio content and each user can listen to it right on the website. In order ...
0
votes
1answer
374 views

How to use limit_conn and limit_req modules of Nginx when it is behind HAProxy

I'm using limit_conn_zone (with limit_conn) and limit_req_zone (with limit_req) in Nginx which sits behind a HAProxy. They both run on the same host. I see whenever a limit is breached in Nginx ...
3
votes
2answers
1k views

nginx rate limiting with X-Forwarded-For header

I'm looking into rate-limiting using nginx's HttpLimitReqModule. However, requests are all coming from the same IP (a loadbalancer), with the real IP address in the headers. Is there a way to have ...
0
votes
0answers
315 views

Different limit_req depending on get argument in Nginx

How can I use different limit_req for one location depending if a get-argument is present or not? In logic: if($_GET['a']){ applyLimitA(); }else{ applyLimitB(); } I have achieved this but ...
1
vote
1answer
1k views

Nginx - What is does the nodelay option do when limiting requests?

With the nginx HttpLimitReq module requests can be limited by IP. However, I'm not understanding what the "nodelay" option does. If the excess requests within the limit burst delay are not ...
4
votes
1answer
3k views

How to rate-limit in nginx, but including/excluding certain IP addresses?

I'm able to use limit_req to rate-limit all requests to my server. However I'd like to remove the rate restriction for certain IP addresses (i.e. whitelist) and use a different rate restriction for ...
2
votes
1answer
1k views

How soon does nginx's token bucket replenish when limiting at requests per minute?

We've decided that we want to experiment and limit requests per minute instead of requests per second on our sites. However, I am confused by the burst parameter in this context. I am under the ...