-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请教一下使用Nginx反代如何获取真实IP #32
Labels
enhancement
New feature or request
Comments
未有相关参数, 后续添加 |
还有测试下载的文件希望也能识别一下 hostname,而不是默认用ip地址。 |
已在 #33 修复 |
同样使用nginx反代到https协议下面,指定location /looking_glass |
#38 修复了. |
反代时添加以下参数到相关 vhost 中即可
创建容器的时候带上环境变量
已在 #40 中实现 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使用Docker安装的 并且将端口改为8800,具体部署命令如下:
docker run -d --restart always
--name lookingglass
-e HTTP_PORT=8800
-p 8800:8800
wikihostinc/looking-glass-server
在使用Nginx将端口反代到域名时发现反代后无法正确识别IP地址,IP地址显示为172.17.0.1,
![image](https://user-images.githubusercontent.com/120082034/211702860-545016c2-fbae-4df2-8a2a-c29d35aa7697.png)
Nginx配置如下:
#PROXY-START/
location /
{
proxy_pass http://127.0.0.1:8800;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_http_version 1.1;
}
#PROXY-END/
想请教下如何配置能获取到访问的真实IP呢?
The text was updated successfully, but these errors were encountered: