[英]Why aren't my creds being passed into my nginx.conf?
我原来的 nginx.conf:
events {}
http {
server {
include credentials.conf;
listen 80;
location / {
proxy_set_header Authorization $credentials;
proxy_pass [website_of_choice];
}
}
}
我的凭据.conf:
set $credentials 'Basic [long_encoded_login_details]';
但这在 nginx 启动时不起作用。
在某些情况下,使用.conf
作为文件结尾将不起作用。 这应该会给您一个错误,尝试重新加载 nginx sudo nginx -s reload
或nginx -t
on configtest。 这取决于您的 nginx.conf。 检查是否有任何include
指令,包括给定目录中的任何*.conf
内容。
用这个
凭据.include
set $credentials 'Basic [long_encoded_login_details]';
nginx.conf
events {}
http {
server {
include credentials.include;
listen 80;
location / {
proxy_set_header Authorization $credentials;
proxy_pass [website_of_choice];
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.