fix: nginx sse in reverse proxy

This commit is contained in:
efim 2023-11-26 04:51:08 +00:00
parent 1a567c6e12
commit f279f8ae05
2 changed files with 6 additions and 0 deletions

View File

@ -110,6 +110,11 @@
locations."/" = {
proxyPass = "http://127.0.0.1:${toString cfg.port}";
};
extraConfig = ''
# check http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive
proxy_set_header Connection "";
proxy_http_version 1.1;
'';
};
};
services.redis.servers.${pname} = {

View File

@ -70,6 +70,7 @@ func streamingRoomStates(
w.Header().Set("Cache-Control", "no-cache")
w.Header().Set("Connection", "keep-alive")
w.Header().Set("Content-Type", "text/event-stream")
w.Header().Set("X-Accel-Buffering", "no")
templFile := "templates/room.gohtml"
tableTemplates := "templates/tableTemplates.gohtml"