Skip to content
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

github 授权登录出错 #902

Closed
pangguoming opened this issue Oct 26, 2016 · 13 comments
Closed

github 授权登录出错 #902

pangguoming opened this issue Oct 26, 2016 · 13 comments

Comments

@pangguoming
Copy link

image

@TakWolf
Copy link
Contributor

TakWolf commented Oct 26, 2016

错误已经表明了,需要添加 x-real-ip 头
你是不是nginx代理配置有问题

@pangguoming
Copy link
Author

pangguoming commented Oct 26, 2016

我没有用nginx, 直接node 接80端口,是在AWS 上Centos 虚拟机上弄的

@pangguoming
Copy link
Author

另外邮箱 也无法发信
image

@TakWolf
Copy link
Contributor

TakWolf commented Oct 26, 2016

邮件的所有问题看这个:#854

github内个错误出现的条件在详细说明一下

@pangguoming
Copy link
Author

github 登录的报错上面说了,用的是 AWS Centos 虚拟机 发布的网址http://neo4j.com.cn/
只装了node.js , mongodb, redis, neo4j

@pangguoming
Copy link
Author

@TakWolf ??

@TakWolf
Copy link
Contributor

TakWolf commented Oct 26, 2016

没遇到过这个问题,感觉上是github配置有问题
这里的配置你贴一下

@pangguoming
Copy link
Author

@TakWolf
image

@pangguoming
Copy link
Author

image

@pangguoming
Copy link
Author

@alsotang

@TakWolf
Copy link
Contributor

TakWolf commented Oct 27, 2016

不知道了,没遇到过这个错误。
感觉你的配置没有问题。
猜测问题仍然出在代理层上。
Github内部可能要验证客户端ip,如果走了代理,clientIp就变成服务端的了,所以通常用 x-real-ip 记录原始的ip地址。

AWS Centos 虚拟机
这个东西我没用过,不了解。他的网络拓扑是怎么做的?
你检查一下是不是跟这个东西有关系

@pangguoming
Copy link
Author

@TakWolf 找到原因了,还没有解决办法
代码:nodeclub-master\middlewares\limit.js 最后面 读req.get('x-real-ip') ,返回空了,
image

因为,在AWS EC2实例中:
http://stackoverflow.com/questions/25722205/x-real-ip-x-forwarded-for-headers-always-null-on-ec2tomcat

,需要改下代码

@pangguoming
Copy link
Author

@TakWolf 搞定了,
req.get('x-real-ip')换成 req.connection.remoteAddress;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants