From fee1313b6903381a2a9e8a8166824fe01f783a4e Mon Sep 17 00:00:00 2001
From: luzzi <christopher.luzzi@student.reutlingen-university.de>
Date: Tue, 20 Dec 2022 17:16:49 +0100
Subject: [PATCH] Afg3

---
 nginx.conf | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 nginx.conf

diff --git a/nginx.conf b/nginx.conf
new file mode 100644
index 0000000..cef84e4
--- /dev/null
+++ b/nginx.conf
@@ -0,0 +1,37 @@
+worker_processes 4;
+
+events {
+  worker_connections 1024;
+}
+
+http {
+  server {
+    listen 80;
+
+    location / {
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+      proxy_set_header Host $host;
+
+      proxy_pass http://nodes;
+
+      # enable WebSockets
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection "upgrade";
+    }
+  }
+
+  upstream nodes {
+    # enable sticky session with either "hash" (uses the complete IP address)
+    hash $remote_addr consistent;
+    # or "ip_hash" (uses the first three octets of the client IPv4 address, or the entire IPv6 address)
+    # ip_hash;
+    # or "sticky" (needs commercial subscription)
+    # sticky cookie srv_id expires=1h domain=.example.com path=/;
+
+    server server-john:3000;
+    server server-paul:3000;
+    server server-george:3000;
+    server server-ringo:3000;
+  }
+}
\ No newline at end of file
-- 
GitLab