From 7508056f709c26f33ea33b1dd9d28564d0ecfda6 Mon Sep 17 00:00:00 2001 From: Lukas Schulz Date: Sat, 25 Jul 2020 16:43:01 +0200 Subject: [PATCH] Add new file --- load-balancer.conf | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 load-balancer.conf diff --git a/load-balancer.conf b/load-balancer.conf new file mode 100644 index 0000000..be041da --- /dev/null +++ b/load-balancer.conf @@ -0,0 +1,24 @@ +user www-data; +worker_processes auto; +pid /run/nginx.pid; +include /etc/nginx/modules-enabled/*.conf; + +events { + worker_connections 768; + # multi_accept on; +} + + +http { + split_clients "${remote_addr}" $cdnhosts { + 50% "cdn-node1.domain.tld"; + 50% "cdn-node2.domain.tld0"; + } + server { + listen 8080; + listen [::]:8080; + location / { + return 301 "http://${cdnhosts}${request_uri}"; + } + } +} \ No newline at end of file