<p>Is proxy_pass supposed to call something with a .eve extension?</p>
<p><blockquote type="cite">On Jan 4, 2010 11:50 PM, "davvv" <<a href="mailto:nginx-forum@nginx.us">nginx-forum@nginx.us</a>> wrote:<br><br>I wrote a very scalable HTTP event server in C++ and I would like to make it work with nginx.<br>
My server is on port 9001, PHP-FPM is running on port 9000.<br>
<br>
My server is set up to return a 504 error when an event is found, and the 504 error should trigger the PHP backend.<br>
I've been trying to figure out a way to make it work with nginx and it's something so elementary, I think I'm just being really stupid.. so I need some help.<br>
<br>
This is basically a short rundown of what happens.<br>
A client hits something like <a href="http://myhost.com/event/" target="_blank">myhost.com/event/</a>, and hangs until there is an event to server, expiring after 30 seconds by default (if it expires, my server returns a "NO EVENT" reply, which works); however, if there IS an event, my server is set up to kick off the client, triggering a 504. Somehow I want to catch that 504, and redirect the client to a PHP backend (with the query intact).<br>
<br>
This is what I have so far. I haven't worked much with nginx so bear with me...<br>
<br>
location /event/ {<br>
proxy_pass <a href="http://localhost:9001/callback.eve" target="_blank">http://localhost:9001/callback.eve</a>;<br>
proxy_intercept_errors on;<br>
error_page 504 = @fallback; #if I straight up put backend.php here, the POST/GET variables disappear<br>
}<br>
<br>
location @fallback {<br>
internal;<br>
fastcgi_param SCRIPT_FILENAME $document_root/backend.php;<br>
fastcgi_param QUERY_STRING $query_string;<br>
include fastcgi_params;<br>
fastcgi_pass <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;<br>
}<br>
<br>
I get some really strange results with the aforementioned config.. nginx doesn't break, I don't get an error or anything. PHP doesn't break either. All I get is a blank page (as in, totally blank) with a 200 OK code. I'm really confused here, and I'm almost certain there has to be an easy way of doing this<br>
<br>
Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,36944,36944#msg-36944" target="_blank">http://forum.nginx.org/read.php?2,36944,36944#msg-36944</a><br>
<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></p>