EOS Low-Code Platform 8 EOS Low-Code Platform 8
产品简介
学习指南
更新说明
安装与集成
初见EOS
低代码开发手册
专业代码开发手册
专题场景实战
公共服务框架
应用运行治理
常见问题
  • 在线用户真实登录IP获取配置

# 在线用户真实登录IP获取配置

在线用户中获取查看用户登录IP不是真实用户登录IP时,可以在nginx的配置文件中增加如下配置来获取用户真实IP。

server {
     listen       ${listenPort};
     location / {
            root  ${userDir}${appDir};
            index  index.html index.htm;
            try_files $uri /index.html;
        }
        location ~/(.*)/api/{
        	# 真实ip配置开始
            proxy_set_header Host $host;
     		proxy_set_header X-Real-IP $remote_addr;
     		proxy_set_header X-Real-Port $remote_port;
     		proxy_set_header REMOTE-HOST $remote_addr;
     		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     		# 真实ip配置结束
     		proxy_set_header X-EOS-SourceSysKey ssssxxxxxx;
            proxy_pass http://xxxxx:xxx;
        }
        ....
        
    }

AFCenter中的nginx配置中的~/(.*)/api/路由就是AFCenter的代理路由,只需将配置添加在这个location中即可。

← 微服务应用打包、部署、运行方案 项目开发集成规范 →