<div dir="ltr">This can be done using ngx_http_limit_req_module - <a href="http://nginx.org/en/docs/http/ngx_http_limit_req_module.html">http://nginx.org/en/docs/http/ngx_http_limit_req_module.html</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 25, 2016 at 4:01 PM, hide <span dir="ltr"><<a href="mailto:nginx-forum@forum.nginx.org" target="_blank">nginx-forum@forum.nginx.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<br>
My Nginx does fastcgi_pass to some CGI application. The CGI application can<br>
return HTTP status code 401. I want Nginx to return this status code to the<br>
user and prevent the next access of the user to the CGI application for 5<br>
seconds.<br>
<br>
For example, the user accessed the CGI application through Nginx and got<br>
HTTP status code 401 at 17:40:40. Suppose that the IP address of the user is<br>
trying to access the CGI application through Nginx for the second time at<br>
17:40:42. I want Nginx to provide that this second request will not reach<br>
the CGI application. Then the IP address of the user is trying to access the<br>
CGI application through Nginx for the third time at 17:40:46. I want Nginx<br>
to let this third request go to the CGI application because 5 seconds have<br>
already passed. Suppose that this third request has worked successfully with<br>
HTTP status code 200. Then the IP address of the user is trying to access<br>
the CGI application through Nginx for the fourth time at 17:40:47. I want<br>
Nginx to let this fourth request go to the CGI application because 5 seconds<br>
from HTTP code 401 have already passed.<br>
<br>
Can I do this with Nginx?<br>
<br>
Thank you if you answer.<br>
<br>
Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,270537,270537#msg-270537" rel="noreferrer" target="_blank">https://forum.nginx.org/read.<wbr>php?2,270537,270537#msg-270537</a><br>
<br>
______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>