Created
January 12, 2015 17:16
-
-
Save flaviomuniz/1e426a290182635df7b2 to your computer and use it in GitHub Desktop.
loadbalancer nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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