Skip to content

Instantly share code, notes, and snippets.

@flaviomuniz
Created January 12, 2015 17:16
Show Gist options
  • Save flaviomuniz/1e426a290182635df7b2 to your computer and use it in GitHub Desktop.
Save flaviomuniz/1e426a290182635df7b2 to your computer and use it in GitHub Desktop.
loadbalancer nginx
upstream _name_ {
server ip_1:port;
server ip_2:port;
server ip_3:port;
server ip_4:port;
...
}
server {
listen 80;
server_name _;
root /var/www/_name_;
try_files @unicorn index.html;
location @unicorn {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://_name_;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment