admin管理员组文章数量:1391955
I use nginx to proxy requests to the Server Sent Events API. Without nginx everything works fine, but when proxying through nginx the event body is cut off and further events do not arrive.
Nginx replaces the "Transfer-Encoding: chunked" header with "Content-Length". Nginx runs in the jwilder/nginx-proxy Docker image, if that matters.
I have already tried everything that is commented out and it does not work:
#gzip on;
#gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/json;
server {
listen 80;
listen [::]:80;
server_name localhost;
#chunked_transfer_encoding on;
location /api {
proxy_pass http://localhost:8080/api;
#proxy_set_header Transfer-Encoding "chunked";
#proxy_http_version 1.1;
#proxy_set_header Host $host;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header Connection "";
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Accel-Buffering "no";
#proxy_set_header Content-Type "text/event-stream";
#proxy_set_header Cache-Control "no-cache";
#proxy_buffering off;
#proxy_request_buffering off;
#proxy_pass_request_headers on;
#chunked_transfer_encoding off; #also tried "on"
#proxy_cache off;
#proxy_set_header TestHeader "testHeaderValue";
#keepalive_timeout 65;
#add_header Cache-Control no-cache;
}
}
本文标签: server sent eventsNginx cuts off data and does not use TransferEncoding chunkedStack Overflow
版权声明:本文标题:server sent events - Nginx cuts off data and does not use Transfer-Encoding: chunked - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744756551a2623498.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论