Last active
August 29, 2015 13:57
-
-
Save z3cka/9475824 to your computer and use it in GitHub Desktop.
example of a load balancer config via nginx's upstream module
This file contains hidden or 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
events { | |
worker_connections 1024; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
upstream stageEnd { | |
# server stage.library.unlv.edu; | |
server www-b.library.unlv.edu weight=4; | |
} | |
server { | |
listen 80; | |
return 301 https://$host$request_uri; | |
server_name stagefront.library.unlv.edu; | |
location / { | |
proxy_pass http://stageEnd; | |
proxy_http_version 1.1; | |
proxy_set_header Host stagefront.library.unlv.edu; | |
} | |
} | |
server { | |
listen 443; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/stagefront.crt; | |
ssl_certificate_key /etc/nginx/ssl/stagefront.key; | |
server_name stagefront.library.unlv.edu; | |
access_log /var/log/nginx/ssl.access.log; | |
error_log /var/log/nginx/ssl.error.log; | |
location / { | |
proxy_pass http://stageEnd; | |
proxy_http_version 1.1; | |
proxy_set_header Host stagefront.library.unlv.edu; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jfox added some proxy cache stuff...