Skip to content

Commit 973303a

Browse files
committed
fix sse?
1 parent 97f2eba commit 973303a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docker/nginx.conf

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
events {}
22
http {
33
upstream app { server 127.0.0.1:3000; }
4+
gzip off;
45

56
server {
67
listen 8080;
@@ -80,23 +81,32 @@ http {
8081
}
8182

8283
location /messages {
84+
proxy_http_version 1.1;
85+
proxy_request_buffering off;
8386
proxy_buffering off;
87+
chunked_transfer_encoding off;
8488
proxy_read_timeout 620s;
8589
proxy_send_timeout 620s;
86-
proxy_pass http://app/messages;
90+
proxy_set_header Connection "";
8791
proxy_set_header Host $host;
8892
proxy_set_header X-Forwarded-For $remote_addr;
8993
proxy_set_header X-Forwarded-Proto $scheme;
94+
proxy_pass http://app/messages;
9095
}
9196

9297
location /sse {
98+
proxy_http_version 1.1;
99+
proxy_request_buffering off;
93100
proxy_buffering off;
101+
chunked_transfer_encoding off;
94102
proxy_read_timeout 620s;
95103
proxy_send_timeout 620s;
96-
proxy_pass http://app/sse;
104+
proxy_set_header Connection "";
105+
proxy_set_header Accept "text/event-stream";
97106
proxy_set_header Host $host;
98107
proxy_set_header X-Forwarded-For $remote_addr;
99108
proxy_set_header X-Forwarded-Proto $scheme;
109+
proxy_pass http://app/sse;
100110
}
101111

102112
location /health {

0 commit comments

Comments
 (0)