From 7113d0fe1496d6a4229214f5f4d5f64fe1fc35f1 Mon Sep 17 00:00:00 2001 From: iProbe Date: Fri, 26 Jan 2024 16:44:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Others/=E6=A0=B9=E6=8D=AEg?= =?UTF-8?q?pu=E4=BD=BF=E7=94=A8=E7=8E=87=E8=B0=83=E5=BA=A6/openresty?= =?UTF-8?q?=E9=85=8D=E7=BD=AE.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Others/根据gpu使用率调度/openresty配置.md | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Others/根据gpu使用率调度/openresty配置.md b/Others/根据gpu使用率调度/openresty配置.md index 4f87781..de71035 100644 --- a/Others/根据gpu使用率调度/openresty配置.md +++ b/Others/根据gpu使用率调度/openresty配置.md @@ -1,2 +1,30 @@ ```txt +upstream danceaiStream { + server 106.12.210.129:30963; +} + +# resolver 8.8.8.8; +lua_package_path '/usr/local/openresty/lualib/lb/?.lua;;'; + +server { + listen 80; + server_name 1.94.8.122; + + location / { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Connection ""; + proxy_http_version 1.1; + + set $backend ''; + + rewrite_by_lua_file /usr/local/openresty/lualib/lb/lb.lua; + content_by_lua_block { + ngx.log(ngx.INFO, "backend ", $backend) + } + proxy_pass http://$backend; + } +} + ``` \ No newline at end of file