Skip to content

Instantly share code, notes, and snippets.

@waqaskhan137
Created April 28, 2015 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waqaskhan137/0237c80047ff149c3887 to your computer and use it in GitHub Desktop.
Save waqaskhan137/0237c80047ff149c3887 to your computer and use it in GitHub Desktop.
# Apache servers LB for lb.site.com
upstream lb-site.com {
server 192.168.200.85:8080; # virtual machine web1 site
server 127.0.0.1:8080 backup; # virtual machine web2 site
}
server {
listen 127.0.0.1:80; # public IP address of your server
server_name lb-site.com;
location / {
proxy_pass http://lb-site.com;
proxy_connect_timeout 900;
proxy_send_timeout 900;
proxy_read_timeout 900;
send_timeout 900;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment