Skip to content

Commit

Permalink
adjust nginx config for SSE
Browse files Browse the repository at this point in the history
  • Loading branch information
tobru committed Jun 1, 2024
1 parent 72a579c commit 68874d3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build-push-contactform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- Dockerfile.contactform
- poetry.lock
- pyproject.toml
- nginx.conf
- contactform/**/*
- .github/workflows/build-push-contactform.yaml

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-push-podstatus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- Dockerfile.podstatus
- poetry.lock
- pyproject.toml
- nginx.conf
- podstatus/**/*
- .github/workflows/build-push-podstatus.yaml

Expand Down
14 changes: 13 additions & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -45,4 +57,4 @@ http {
proxy_pass http://app_server;
}
}
}
}

0 comments on commit 68874d3

Please sign in to comment.