Skip to content

Instantly share code, notes, and snippets.

@mbentley
Created February 23, 2017 18:03
Show Gist options
  • Save mbentley/af879a38c964455b335ab7443f7421c8 to your computer and use it in GitHub Desktop.
Save mbentley/af879a38c964455b335ab7443f7421c8 to your computer and use it in GitHub Desktop.
nginx load balancer for UCP
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
stream {
upstream ucp {
server 192.168.100.11:443;
server 192.168.100.12:443;
server 192.168.100.13:443;
}
server {
listen 443;
proxy_pass ucp;
proxy_timeout 120s;
proxy_connect_timeout 15s;
}
}
docker run -d -p 443:443 --restart=unless-stopped --name ddc-lb -v /data/ddc-lb/nginx.conf:/etc/nginx/nginx.conf:ro nginx:stable-alpine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment