Skip to content

Instantly share code, notes, and snippets.

@z3cka
Last active August 29, 2015 13:57
Show Gist options
  • Save z3cka/9475824 to your computer and use it in GitHub Desktop.
Save z3cka/9475824 to your computer and use it in GitHub Desktop.
example of a load balancer config via nginx's upstream module
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;
}
}
}
@z3cka
Copy link
Author

z3cka commented Mar 17, 2014

jfox added some proxy cache stuff...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment