From 68874d39967bdf42b63125c9baaf24b2af243cd8 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Sat, 1 Jun 2024 21:07:29 +0200 Subject: [PATCH] adjust nginx config for SSE --- .github/workflows/build-push-contactform.yaml | 1 + .github/workflows/build-push-podstatus.yaml | 1 + nginx.conf | 14 +++++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-push-contactform.yaml b/.github/workflows/build-push-contactform.yaml index 75bf472..efc12e5 100644 --- a/.github/workflows/build-push-contactform.yaml +++ b/.github/workflows/build-push-contactform.yaml @@ -8,6 +8,7 @@ on: - Dockerfile.contactform - poetry.lock - pyproject.toml + - nginx.conf - contactform/**/* - .github/workflows/build-push-contactform.yaml diff --git a/.github/workflows/build-push-podstatus.yaml b/.github/workflows/build-push-podstatus.yaml index eb0ade0..3f27c0a 100644 --- a/.github/workflows/build-push-podstatus.yaml +++ b/.github/workflows/build-push-podstatus.yaml @@ -8,6 +8,7 @@ on: - Dockerfile.podstatus - poetry.lock - pyproject.toml + - nginx.conf - podstatus/**/* - .github/workflows/build-push-podstatus.yaml diff --git a/nginx.conf b/nginx.conf index 4f10031..f2698ee 100644 --- a/nginx.conf +++ b/nginx.conf @@ -36,6 +36,18 @@ http { try_files $uri @proxy_to_app; } + # Configuration for server-sent events (SSE) + location /stream { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_buffering off; # Disable buffering for SSE + proxy_cache off; # Disable caching for SSE + proxy_read_timeout 3600s; + proxy_pass http://app_server; + } + location @proxy_to_app { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; @@ -45,4 +57,4 @@ http { proxy_pass http://app_server; } } -} \ No newline at end of file +}