I wrote a high-performance HTTP event server in C ++, and I want it to work flawlessly with nginx and PHP-FPM (fastcgi). This is a fragment of my nginx configuration.
location ~ \.eve$ {
gzip off;
proxy_redirect off;
proxy_buffering off;
proxy_pass http://127.0.0.1:9001;
proxy_intercept_errors on;
error_page 505 = @fallback // this is actually BACKEND.php
}
My event server returns 505 errors if there is an event, otherwise it freezes and ultimately returns the "NO STATE CHANGE" directive with which I process JS or whatever you have (this is mainly a comet). The thing is, I would like nginx to catch error 505 and redirect this request to PHP so that PHP can handle the event accordingly. My server is just an event center, allowing many users to connect and see if there are any new events. If there is an event, PHP handles the distribution of events, including permissions and other mutable things.
The problem is that nginx does not pass the POST (or GET) variables that were passed in * .eve to BACKEND.php. Now I assume that this is by design (due to the error_page directive), but I decided there had to be some way to make it work. My server runs on 9001, PHP-FPM runs on 9000. Any ideas?
source
share