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 1
- 程序内容回答过多的时候需要手动下拉才能到最底下
- 怎么在vercel上部署? HOT 1
- 冒昧问下更新后设置key的地方在哪里? HOT 2
- 最新版本【aaae763】的复制功能用不了,麻烦复原下原来的!!! HOT 6
- 【错误】连续对话错误
- 对话失败|怎么设置代理地址? HOT 1
- 随着4o模型的出现,是否能支持多模态的内容输入和输出 HOT 1
- FR: 用户输入增加渲染markdown语法支持 HOT 3
- vision模型图片上传没压缩? HOT 8
- GPT4怎么突然记不住上一段内容? HOT 2
- 4o模型没有图片输入吗 HOT 4
- 建议增加一个默认模型配置项,当前默认gpt-turbo可以一键配置为其它如gpt4-xxx
- 建议增加一个全局搜索的功能 HOT 1
- 设置标志不见了 HOT 1
- 只开发前端,删除service文件夹之后会报错 HOT 1
- 没有使用反代依然没有打字机效果 HOT 1
- 等待回答时,这种效果是否要比现在的效果好呢? HOT 2
- 手工部署项目后500错误 HOT 1
- 大佬们,渲染markdown语法有帮助的 mermaid-it-markdown库可以考虑添加?
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.