Using a file as a flag and proxy_pass to hang a server

btakita nginx-forum at nginx.us
Thu Oct 29 04:01:53 MSK 2009


Hello,

I would like to delay proxying a request for a few second, until the server is ready.

To do this, I'm attempting to use recursion:


if (-f $document_root/block_writes) {
  proxy_pass http://127.0.0.1;
  break;
}



With this technique, I'm able to hang the request by doing:

touch document_root/block_writes



However if I do:

rm document_root/block_writes



the request is still hung.

Am I missing something? How do I get nginx to recheck if the file exists?

Thank you,
Brian

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,17808,17808#msg-17808






More information about the nginx mailing list