From 78cc85cf2d14a5255ea6415bc8df98990e35f9f7 Mon Sep 17 00:00:00 2001 From: hayzamjs Date: Fri, 18 Nov 2022 12:18:58 +0100 Subject: [PATCH] nginx: add reverse proxy route for ttyd --- net/nginx/files-luci-support/60_nginx-luci-support | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/nginx/files-luci-support/60_nginx-luci-support b/net/nginx/files-luci-support/60_nginx-luci-support index b2564444c..700ef797d 100644 --- a/net/nginx/files-luci-support/60_nginx-luci-support +++ b/net/nginx/files-luci-support/60_nginx-luci-support @@ -9,6 +9,14 @@ location /ubus { ubus_socket_path /var/run/ubus/ubus.sock; ubus_parallel_req 2; } + +location ~ ^/ttyd(.*)$ { + proxy_http_version 1.1; + proxy_set_header Upgrade '$http_upgrade'; + proxy_set_header Connection "upgrade"; + proxy_pass http://'$server_addr':7681/'$1'; +} + EOT fi fi