From 368295347e7dcd3c0e6b814c7f232a7dd56bfee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Sat, 29 Dec 2018 11:34:00 +0100 Subject: [PATCH] Configure websocket --- conf/nginx.conf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index fb6260f..3d9e016 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,4 +6,20 @@ location __PATH__/ { include conf.d/yunohost_panel.conf.inc; proxy_set_header Accept-Encoding ""; +} + + +location ~* __PATH__/(api/kernels/[^/]+/(channels|iopub|shell|stdin)|terminals/websocket)/? { + proxy_pass http://localhost:__PORT__; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_http_version 1.1; + + #proxy_set_header Upgrade $http_upgrade; + proxy_set_header Upgrade "websocket"; + proxy_set_header Connection "upgrade"; + proxy_read_timeout 86400; } \ No newline at end of file