Skip to content

Commit

Permalink
Scanning port 10247 lead to tcp connection 502 error (#9815)
Browse files Browse the repository at this point in the history
* fix tcp 502 error

* fix tcp 502 error for parse tcp  backend data

* fix tcp 502 error for parse tcp  backend data
  • Loading branch information
lijiecm authored Jul 16, 2023
1 parent 5b35651 commit 0cd1f16
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rootfs/etc/nginx/lua/tcp_udp_configuration.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local ngx = ngx
local tostring = tostring
local cjson = require("cjson.safe")
-- this is the Lua representation of TCP/UDP Configuration
local tcp_udp_configuration_data = ngx.shared.tcp_udp_configuration_data

Expand Down Expand Up @@ -37,6 +38,14 @@ function _M.call()
return
end

local _, backends_err = cjson.decode(backends)

if backends_err then
ngx.log(ngx.ERR, "could not parse backends data: ", backends_err)
return
end


local success, err_conf = tcp_udp_configuration_data:set("backends", backends)
if not success then
ngx.log(ngx.ERR, "dynamic-configuration: error updating configuration: " .. tostring(err_conf))
Expand Down

0 comments on commit 0cd1f16

Please sign in to comment.