From 33d39519e1bd9bb1451776abe4986cdf4dee7626 Mon Sep 17 00:00:00 2001 From: Suyi Date: Mon, 9 Apr 2018 09:57:59 +0800 Subject: [PATCH] docs(passport): config passport-github behind of proxy (#2318) --- docs/source/zh-cn/tutorials/passport.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/source/zh-cn/tutorials/passport.md b/docs/source/zh-cn/tutorials/passport.md index 7958bb83df..21d1a543b6 100644 --- a/docs/source/zh-cn/tutorials/passport.md +++ b/docs/source/zh-cn/tutorials/passport.md @@ -56,7 +56,9 @@ exports.passportGithub = { // config/default.js config.passportGithub = { key: 'your_clientID', - secret: 'your_clientSecret' + secret: 'your_clientSecret', + // callbackURL: '/passport/github/callback', + // proxy: false, }; ``` @@ -65,6 +67,9 @@ config.passportGithub = { - 填写 `callbackURL`,如 `http://127.0.0.1:7001/passport/github/callback` - 线上部署时需要更新为对应的域名 - 路径为配置的 `options.callbackURL`,默认为 `/passport/${strategy}/callback` +- 如应用部署在 Nginx/HAProxy 之后,需设置插件 `proxy` 选项为 `true`, 并检查以下配置: + - 代理附加 HTTP 头字段:`x-forwarded-proto` 与 `x-forwarded-host` + - 配置中 `config.proxy` 应设置为 `true` ### 挂载路由