From 153ea8e982cc5f8a8da40643c6a52d33278c9417 Mon Sep 17 00:00:00 2001 From: shockrah Date: Thu, 15 May 2025 22:59:07 -0700 Subject: [PATCH] Improving nomad nginx config to be more responsive or soemthing https://developer.hashicorp.com/nomad/tutorials/manage-clusters/reverse-proxy-ui#extend-connection-timeout --- .../roles/local-server-head/files/nomad.conf | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ansible/roles/local-server-head/files/nomad.conf b/ansible/roles/local-server-head/files/nomad.conf index a9818ba..8d9039b 100644 --- a/ansible/roles/local-server-head/files/nomad.conf +++ b/ansible/roles/local-server-head/files/nomad.conf @@ -1,8 +1,25 @@ server { server_name nomad.nigel.local; location / { - proxy_pass http://localhost:4646; + proxy_pass http://nomad-ws; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_read_timeout 319s; + + # This is for log streaming requests + proxy_buffering off; + + # Upgrade and Connection headers for upgrading to websockets + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + + proxy_set_header Origin "${scheme}://${proxy_host}"; } } + +upstream nomad-ws { + ip_hash; + server nomad.nigel.local:4646; +} \ No newline at end of file