Skip to content

Instantly share code, notes, and snippets.

@wojons
Created August 5, 2013 09:35
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save wojons/6154645 to your computer and use it in GitHub Desktop.
Save wojons/6154645 to your computer and use it in GitHub Desktop.
nginx dont retry next upstream on post or put when timeout error
upstream mash {
ip_hash;
server 127.0.0.1:8081;
server 192.168.0.11:8081;
}
server {
location / {
if ($request_method = POST ) {
proxy_next_upstream error;
}
if ($request_method = PUT ) {
proxy_next_upstream error;
}
proxy_pass http://mash/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
@huangjunque
Copy link

good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment