Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
171 views
in Technique[技术] by (71.8m points)

nuxt服务端怎么获取用户的remote_addr

服务器是nginx
nginx的配置如下
image.png

我在axios的拦截器里面增加了一个自定义头u-host用于获取用户的remote_addr,真实环境下我总是获取不到我想要的客户端ip
image.png

这是我python后端程序获取客户端的ip
image.png

我不知道接下来该怎么做才能在nuxt服务端渲染数据的时候还能获取到客户的真实ip,于是求助于社区


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

问题我已经解决了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...