首页

PHP在负载均衡条件下获取客户端ip

业务需要得写一个ip白名单来限制接口访问,laravel下习惯直接$request->ip()或者$request->getClientIp()来获取。测试的时候发现ip不对,原来我又忘了服务器上了负载均衡,所有请求都是负载均衡转发服务的ip。想了下应该从请求头里面拿ip了,问了下chatgt,AI回答很棒: <img src="https://product.liyiru.top/uploads/bc2bb18351e180708f43c9c698db6da9.png"/>
更多>>
浅谈JWT php用strtotime("monday")获取周一产生的bug mysql临时关闭binlog 微信支付的证书问题 拼图小游戏