사용자 도구

사이트 도구


springframework:httpstream

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
springframework:httpstream [2022/01/04 15:12]
kwon37xi [Reverse Proxy(nginx) 설정]
springframework:httpstream [2022/01/04 17:00] (현재)
kwon37xi [ServerSentEvent Reverse Proxy(nginx) 설정]
줄 3: 줄 3:
   * [[springframework:webflux|Spring WebFlux]] 사용시 더 깔끔하다.   * [[springframework:webflux|Spring WebFlux]] 사용시 더 깔끔하다.
  
-===== Reverse Proxy(nginx) 설정 =====+===== ServerSentEvent Reverse Proxy(nginx) 설정 =====
   * [[:nginx|Ngnix]] 같은 reverse proxy 사용시에 buffering 을 끄는 등의 별도 설정이 필요하다.   * [[:nginx|Ngnix]] 같은 reverse proxy 사용시에 buffering 을 끄는 등의 별도 설정이 필요하다.
  
줄 31: 줄 31:
 ... ...
 </code> </code>
-  * 아니면 nginx 의 SSE 관련 url 프록시에 대해서만 ''proxy_buffering off;'' 및 기타 설정.+  * nginx 의 SSE 관련 url 프록시에 대해서만 ''proxy_buffering off;'' 및 기타 설정.
   * [[https://stackoverflow.com/questions/13672743/eventsource-server-sent-events-through-nginx|ruby - EventSource / Server-Sent Events through Nginx - Stack Overflow]] - https://stackoverflow.com/a/13673298/1051402   * [[https://stackoverflow.com/questions/13672743/eventsource-server-sent-events-through-nginx|ruby - EventSource / Server-Sent Events through Nginx - Stack Overflow]] - https://stackoverflow.com/a/13673298/1051402
  
줄 37: 줄 37:
 location /path/to/sse { location /path/to/sse {
   proxy_pass http://upstream;   proxy_pass http://upstream;
-  proxy_buffering off;+  proxy_buffering off; # X-Accel-Buffering: no 와 같은 효과
   proxy_cache off;   proxy_cache off;
   proxy_set_header Host $host;   proxy_set_header Host $host;
줄 45: 줄 45:
 } }
 </code> </code>
 +  * [[https://medium.com/tokopedia-engineering/server-sent-events-26f75e3a5ed2|Server Sent Events. File Upload Progress API using Server… | by Somesh Singh | Tokopedia Engineering | Medium]] : 좀 더 잘 설명돼 있는 듯.
 ===== 참고 ===== ===== 참고 =====
   * [[https://supawer0728.github.io/2018/03/15/spring-http-stereamings/|Spring5에서 HTTP Streaming | 기록은 재산이다]]   * [[https://supawer0728.github.io/2018/03/15/spring-http-stereamings/|Spring5에서 HTTP Streaming | 기록은 재산이다]]
springframework/httpstream.1641276736.txt.gz · 마지막으로 수정됨: 2022/01/04 15:12 저자 kwon37xi