Created
February 25, 2012 21:48
-
-
Save kuleszaj/1911020 to your computer and use it in GitHub Desktop.
Simple nginx load balancer and reverse proxy.
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 rails_application { | |
server 10.0.0.1 max_fails=1 fail_timeout=10s; | |
server 10.0.0.2 max_fails=1 fail_timeout=10s; | |
# and so on: server 10.0.0.x; | |
} | |
upstream legacy_php_application { | |
server 10.0.1.1 max_fails=1 fail_timeout=10s; | |
} | |
server { | |
listen 1.2.3.4:80; | |
server_name railsapp.example.com; | |
location / { | |
proxy_pass http://rails_application; | |
} | |
} | |
server { | |
listen 1.2.3.4:80; | |
server_name phpapp.example.com; | |
location / { | |
proxy_pass http://legacy_php_application; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment