Linux自动获取客户端IP C#后台获取客户端ip(linux +nginx部署.net core Mvc如何获取请求的来自的外网IP)

cd  usr/local
ls                      
cd nginx
ls
cd conf
ls
sudo vim nginx.conf
e
insert -----插入
在location目录下加上
proxy_set_header            X-real-ip $remote_addr;
退出
shift +:  wq         保存

重启
sudo ./nginx -t
       sudo ./nginx -s reload

 

posted @ 2020-06-22 15:46  心中Where_True循环  阅读(423)  评论(0编辑  收藏  举报