문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
springframework:httpstream [2022/01/04 13:43] kwon37xi |
springframework:httpstream [2022/01/04 17:00] kwon37xi [ServerSentEvent Reverse Proxy(nginx) 설정] |
||
---|---|---|---|
줄 3: | 줄 3: | ||
* [[springframework: | * [[springframework: | ||
+ | ===== ServerSentEvent Reverse Proxy(nginx) 설정 ===== | ||
+ | * [[: | ||
+ | |||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * 서버측에서 '' | ||
+ | * [[https:// | ||
+ | <code java> | ||
+ | @RequestMapping("/ | ||
+ | public SseEmitter getRealTimeJudgeResultAction(HttpServletResponse response) throws IOException { | ||
+ | // .... | ||
+ | response.addHeader(" | ||
+ | SseEmitter sseEmitter = new SseEmitter(); | ||
+ | // .... | ||
+ | sseEmitter.send(" | ||
+ | return sseEmitter; | ||
+ | } | ||
+ | </ | ||
+ | < | ||
+ | # 응답 결과를 보면 X-Accel-Buffering: | ||
+ | curl -D - http://.... | ||
+ | HTTP/1.1 200 | ||
+ | X-Accel-Buffering: | ||
+ | Content-Type: | ||
+ | Transfer-Encoding: | ||
+ | ... | ||
+ | </ | ||
+ | * nginx 의 SSE 관련 url 프록시에 대해서만 '' | ||
+ | * [[https:// | ||
+ | |||
+ | < | ||
+ | location / | ||
+ | proxy_pass http:// | ||
+ | proxy_buffering off; # X-Accel-Buffering: | ||
+ | proxy_cache off; | ||
+ | proxy_set_header Host $host; | ||
+ | proxy_set_header Connection ''; | ||
+ | proxy_http_version 1.1; | ||
+ | chunked_transfer_encoding off; | ||
+ | } | ||
+ | </ | ||
+ | * [[https:// | ||
===== 참고 ===== | ===== 참고 ===== | ||
* [[https:// | * [[https:// |