Comments (2)
This would be an elegant solution for Nginx reverse proxy user, thanks for sharing!
My use case is a bit different, I'm using Kubernetes + nginx ingress controller, which has a more convoluted syntax and less documentation on this topic.
In case it helps someone, here's how to configure nginx ingress annotations to pass X-Email in addition to Remote-Email:
nginx.ingress.kubernetes.io/auth-response-headers: Remote-User,Remote-Name,Remote-Groups,Remote-Email
nginx.ingress.kubernetes.io/auth-snippet: |
proxy_set_header X-Forwarded-Method $request_method;
nginx.ingress.kubernetes.io/configuration-snippet: |
auth_request_set $email $upstream_http_remote_email;
proxy_set_header X-Email $email;
@BobDu would you consider accepting a PR to make the auth header configurable, I feel that this could be beneficial for people with different proxy setups.
from chatgpt-web.
Thank you for your feedback. In fact, using the following configuration should work properly.
## Send a subrequest to Authelia to verify if the user is authenticated and has permission to access the resource.
auth_request /authelia;
## Set the $target_url variable based on the original request.
## Comment this line if you're using nginx without the http_set_misc module.
set_escape_uri $target_url $scheme://$http_host$request_uri;
## Uncomment this line if you're using NGINX without the http_set_misc module.
# set $target_url $scheme://$http_host$request_uri;
## Save the upstream response headers from Authelia to variables.
auth_request_set $email $upstream_http_remote_email;
## Inject the response headers from the variables into the request made to the backend.
proxy_set_header X-Email $email;
## If the subreqest returns 200 pass to the backend, if the subrequest returns 401 redirect to the portal.
error_page 401 =302 https://auth.example.com/?rd=$target_url;
Different from the examples in Authelia's documentation,
it uses proxy_set_header X-Email $email;
instead of proxy_set_header Remote-Email $email;
.
https://www.authelia.com/integration/proxies/nginx/#authelia-authrequestconf
from chatgpt-web.
Related Issues (20)
- 显示异常 HOT 3
- 使用apikey出现问题
- 旧版本node:lts-alpine会导致打包后镜像不可用
- 在使用coze-discord-proxy作为代理产生了一些问题 HOT 1
- Railway 部署报错:500 Server error
- 增加了图片生成和图片识别功能 HOT 13
- 可否在设置里增加显示版本号? HOT 1
- 主分支有问题,后端无法启动
- docker部署报错500,但是可以跳转 HOT 8
- vercel部署后异常,似乎不支持,能否增加对vercel的支持
- [help] 不会配置chatgpt的接入点 HOT 2
- 兑换码功能使用 HOT 3
- 【需求】加个弹窗或通知窗口 HOT 2
- 建议将提问次数改成额度 HOT 7
- 接口列表中能否增加Claude3的API接口? HOT 2
- Unable to access settings via cloudflared tunnel. Able to access user settings via local host. HOT 2
- pnpm build 前端出错 HOT 2
- 为什么我运行起来的项目 没有登录注册和设置功能 HOT 1
- 环境设置ROOT_USER为自己的邮箱,登录提示账户状态异常 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatgpt-web.