refactor: 指定合法代理ip解决无法在代理情况获取真实客户端ip问题
This commit is contained in:
@@ -4,5 +4,12 @@ namespace app;
|
||||
// 应用请求对象类
|
||||
class Request extends \think\Request
|
||||
{
|
||||
protected $proxyServerIp = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// 设置前端代理服务器IP地址,让代理访问情况下,正确获取真实客户端IP地址
|
||||
$this->proxyServerIp = env('PROXY_SERVER_IP', ['120.79.27.160']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user