需求描述 不通的网络环境下,可能需要设置静态IP地址,或设置为动态获取,每次重复手动的配置费时费力,通过脚本可以实现一键设置 脚本实现 1.设置静态IP 1.1新建文本文档,复制粘贴如下内容 netsh interface ip set address name= netsh interface ip set dns name="本地连接" source=static addr=202.196.64.1 1.2修改文件后缀名为 .bat 1.3鼠标右键以管理员身份运行上述bat脚本即
人狠话不多,直接上代码:------------------------------------------------------------------------------------- local headers=ngx.req.get_headers() local clientIP = headers["x-forwarded-for"] or clientIP == "unknown" then clientIP = headers["Pr