--获取客户端ip
function get_client_ip()
    local headers=ngx.req.get_headers()
    local ip=headers["X-REAL-IP"] or headers["X_FORWARDED_FOR"] or ngx.var.remote_addr or "0.0.0.0"
    return ip
end

 

相关文章:

  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2021-10-02
相关资源
相似解决方案