Google社交登录适用于localhost,例如localhost:8888/portal
,
仍然在主机为domain.com/portal
的生产系统上,
redirect_url 不正确domain:8888/portal
,
不 domain.com/portal
生产应用程序支持docker中的nginx代理:
location /portal {
proxy_pass http://domain:8888;
}
https://accounts.google.com/o/oauth2/auth?clie...
client_id=...
response_type=code
_csrf=
redirect_uri=http://domain:8888/portal/signin/google
scope=...
state=
答案 0 :(得分:0)
问题出在nginx反向代理配置中:
之前(有问题)
location /portal {
proxy_pass http://site:8888;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
之后(修复问题)
location /portal {
proxy_pass http://site:8888;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $scheme;
}