登录管理员不适用于icecast服务器

问题描述 投票:0回答:1

我已经为我们的生产icecast服务器设置了几乎相同的登台服务器。

但是我遇到的一个问题(尝试创建挂载点)是登录管理员。

==> /var/log/icecast2/access.log <==
10.0.0.42 - - [27/Aug/2018:18:16:05 +0000] "GET /admin/ HTTP/1.1" 401 331 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.344 0.106 Safari/537.36" 0

==> /var/log/icecast2/error.log <== [2018-08-27  18:16:05] INFO admin/admin_handle_request Bad or missing password on admin command request (command: )

在生产中不会发生这种情况。

现在唯一的区别是我通过kubernetes在nginx入口上设置了这个登台服务器。

nginx kubernetes admin icecast nginx-ingress
1个回答
1
投票

如果我们将您的日志条目与默认的Nginx日志格式进行比较:

10.0.0.42 - [27/Aug/2018:18:16:05 +0000] "GET /admin/ HTTP/1.1" 401
$remote_addr $remote_user [$time_local] "$request" $status

IP地址和时间之间的-表示$remote_user变量未与此请求一起发送。

此变量获取随基本身份验证提供的用户名的值,因此如果未将此值传递给您的Icecast服务器。

你的Nginx conf文件是什么样的?如果您使用proxy_pass指令将请求路由到icecast服务器,则可能需要专门传递auth标头,如下所示:

proxy_set_header Authorization $http_authorization;

您可能还会发现Icecast中的某些路径无法正常工作,但如果您的Nginx构建具有sub_filter模块,则可以重写它们,如下所示:

sub_filter_types text/xhtml text/xml text/css;
sub_filter 'href="/'  'href="<external-url>';
sub_filter 'url(/'  'url(<external-url>';
sub_filter_once off;
sub_filter_last_modified on;
proxy_set_header Accept-Encoding "";

没有理由你不能通过Nginx访问管理页面,只需要稍微调整一下。我以这种方式运行生产服务器。

© www.soinside.com 2019 - 2024. All rights reserved.