4

Use upstream servers based on request method with NGINX

view full story
linux-howto

http://serverfault.com – i'm using nginx's upstream directive to do some load balancing. But i want to handle the POST requests and the requests for /upload directory by my main server. how can i tell nginx "dont proxy pass if the request method is POST or the url contains /admin or /upload"? my current upstreams looks like this: upstream appcluster { ip_hash; server 10.200.0.194:9000; } upstream admincluster { ip_hash; server unix:/tmp/php5-fpm.sock; } and my sites-enabled/default location ~ \.php(.*)$ { tr (HowTos)