From aac361686fb8f2d79cedaa6ed5c1eb524a7fb2d1 Mon Sep 17 00:00:00 2001 From: Hengqi Chen Date: Tue, 16 Jun 2026 14:42:23 +0800 Subject: [PATCH] CubeProxy: Disable buffering for PTY streams Signed-off-by: Hengqi Chen --- CubeProxy/nginx.conf | 68 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/CubeProxy/nginx.conf b/CubeProxy/nginx.conf index 45963a40..e8d842fb 100644 --- a/CubeProxy/nginx.conf +++ b/CubeProxy/nginx.conf @@ -133,6 +133,40 @@ http { log_by_lua_file lua/log_phase.lua; } + # Streaming gRPC SendInput: disable response buffering so each chunk + # from upstream is forwarded to the client immediately. + location = /process.Process/SendInput { + include /usr/local/openresty/nginx/conf/global/global.conf; + set $cube_retcode "310200"; + set $garyscale_test "none"; + set $backend_ip ""; + set $backend_port ""; + set $access_time ""; + set $cache_free_space ""; + set $host_proxy_port 8081; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_send_timeout 7206s; + proxy_read_timeout 7206s; + proxy_connect_timeout 3s; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_buffering off; + + rewrite_by_lua_file lua/rewrite_phase.lua; + + proxy_pass http://backend; + + header_filter_by_lua_file lua/header_filter_phase.lua; + + log_by_lua_file lua/log_phase.lua; + } + location / { include /usr/local/openresty/nginx/conf/global/global.conf; set $cube_retcode "310200"; @@ -213,6 +247,40 @@ http { log_by_lua_file lua/log_phase.lua; } + # Streaming gRPC SendInput: disable response buffering so each chunk + # from upstream is forwarded to the client immediately. + location = /process.Process/SendInput { + include /usr/local/openresty/nginx/conf/global/global.conf; + set $cube_retcode "310200"; + set $garyscale_test "none"; + set $backend_ip ""; + set $backend_port ""; + set $access_time ""; + set $cache_free_space ""; + set $host_proxy_port 8080; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_send_timeout 7206s; + proxy_read_timeout 7206s; + proxy_connect_timeout 3s; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_buffering off; + + rewrite_by_lua_file lua/rewrite_phase.lua; + + proxy_pass http://backend; + + header_filter_by_lua_file lua/header_filter_phase.lua; + + log_by_lua_file lua/log_phase.lua; + } + location / { include /usr/local/openresty/nginx/conf/global/global.conf; set $cube_retcode "310200";