要在Authelia和nginx代理中设置空的用户名和组,可以按照以下步骤进行操作:
步骤 1:安装和配置Authelia
安装Authelia,可以参考官方文档或使用适用于你的操作系统的包管理器进行安装。
配置Authelia,确保你在配置文件中将用户名和组设置为空。配置文件通常位于config.yml
或authelia.yml
。
# authelia.yml
# ...
authentication_backend:
file:
path: /path/to/users.yml
# ...
authorization_backend:
file:
path: /path/to/groups.yml
# ...
# users.yml
users:
- username: ""
password: "your_password_here"
hashed_password: false
# ...
# groups.yml
groups:
- name: ""
members:
- ""
- ""
# ...
步骤 2:配置nginx代理
authelia.conf
,并将以下代码添加到文件中:server {
listen 80;
server_name your_domain.com;
location / {
proxy_pass http://localhost:9091; # Authelia的地址和端口
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
步骤 3:启动Authelia和nginx代理
sudo nginx -c /path/to/authelia.conf
这样,Authelia将接受空的用户名和组,并将请求代理到后端应用程序。请确保将your_domain.com
替换为你的域名或IP地址,并根据实际情况修改其他配置文件中的路径。