【发布时间】:2021-06-30 03:50:54
【问题描述】:
我原来的 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 启动时不起作用。
【问题讨论】:
-
这应该可以,你得到什么错误?
-
当我对凭据进行硬编码 = 我的 webapp 上的 iframe 显示它的内容。当我使用上述方法时:我在 iframe 中收到“localhost 无法连接”。
-
启用调试模式(找到error_log指令并使用日志级别
debug)查看发送到后端的实际请求。此配置将起作用。它在我的实验室工作。
标签: linux nginx nginx-reverse-proxy nginx-config