我有一个运行在8000端口上的icecast服务器,但是当我使用NGINX设置代理时,我似乎无法使它看起来像原来的服务器。
我想知道是否有类似的NGINX停在8000港口,但允许从80港通行的NGINX?
server {
listen 80;
listen [::]:80;
server_name example.com;
gzip on;
gzip_proxied any;
gzip_comp_level 4;
gzip_types text/css application/javascript image/svg+xml;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
location / {
proxy_pass http://127.0.0.1:8000/;
}
}我也试过
server {
listen 80;
listen [::]:80;
server_name onlineradio.example.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
location / {
proxy_set_header Accept-Encoding "";
proxy_pass http://127.0.0.1:8000/;
sub_filter_types application/xspf+xml audio/x-mpegurl audio/x-vclt text/css text/html text/xml;
sub_filter ':8000/' '/';
sub_filter '@localhost' '@onlineradio.example.com';
sub_filter 'localhost' $host;
sub_filter 'Mount Point ' $host;
}
}但是,当我尝试通过我的Nodejs应用程序连接到它时,它在使用包var icecast = require('icecast-stack')时不会加载
我知道插件寻找icy-metaint,这是一个头,冰淇淋流有。
据我所知,我的NGINX需要传递那个标题
我需要传递的标题是来自https://stream.radiomedia.com.au:8003/stream的
Headers(16) °
°String: 'Server: Icecast 2.4.4'é à
key: 'Server',
value: 'Icecast 2.4.4'
è,
°String: 'Connection: Close'é à key: 'Connection', value: 'Close' è,
°String: 'Date: Tue, 08 Nov 2022 06:53:55 GMT'é à
key: 'Date',
value: 'Tue, 08 Nov 2022 06:53:55 GMT'
è,
°String: 'Content-Type: audio/mpeg'é à
key: 'Content-Type',
value: 'audio/mpeg'
è,
°String: 'Cache-Control: no-cache, no-store'é à
key: 'Cache-Control',
value: 'no-cache, no-store'
è,
°String: 'Expires: Mon, 26 Jul 1997 05:00:00 GMT'é à
key: 'Expires',
value: 'Mon, 26 Jul 1997 05:00:00 GMT'
è,
°String: 'Pragma: no-cache'é à key: 'Pragma', value: 'no-cache' è,
°String: 'icy-br:128'é à key: 'icy-br', value: '128' è,
°String: 'ice-audio-info: ice-samplerate=44100;ice-bitrate=128;ice-channels=2'é à
key: 'ice-audio-info',
value: 'ice-samplerate=44100;ice-bitrate=128;ice-channels=2'
è,
°String: 'icy-br:128'é à key: 'icy-br', value: '128' è,
°String: 'icy-description:The Sound Of Indie'é à
key: 'icy-description',
value: 'The Sound Of Indie'
è,
°String: 'icy-genre:indie'é à key: 'icy-genre', value: 'indie' è,
°String: 'icy-name:DRN1'é à key: 'icy-name', value: 'DRN1' è,
°String: 'icy-pub:1'é à key: 'icy-pub', value: '1' è,
°String: 'icy-url:http://DOMAIN GO HERE à
key: 'icy-url',
value: 'http://DOMAIN GO HERE.com'
è,
°String: 'icy-metaint:16000'é à key: 'icy-metaint', value: '16000' è,
server: 'Icecast 2.4.4',
Server: 'Icecast 2.4.4',
connection: 'Close',
Connection: 'Close',
date: 'Tue, 08 Nov 2022 06:53:55 GMT',
Date: 'Tue, 08 Nov 2022 06:53:55 GMT',
'content-type': 'audio/mpeg',
'Content-Type': 'audio/mpeg',
'cache-control': 'no-cache, no-store',
'Cache-Control': 'no-cache, no-store',
expires: 'Mon, 26 Jul 1997 05:00:00 GMT',
Expires: 'Mon, 26 Jul 1997 05:00:00 GMT',
pragma: 'no-cache',
Pragma: 'no-cache',
'icy-br': '128',
'ice-audio-info': 'ice-samplerate=44100;ice-bitrate=128;ice-channels=2',
'icy-description': 'The Sound Of Indie',
'icy-genre': 'indie',
'icy-name': 'DOMAIN',
'icy-pub': '1',
'icy-url': 'http://DOMAIn GIO here.com',
'icy-metaint': '16000'发布于 2022-11-08 07:54:35
已经有以前关于这一主题的问题了
通常,不建议反向代理Icecast,因为它很难涵盖所有的基础,并使事情正确运作。事情会以微妙和意想不到的方式破裂。
也就是说,有人有将他们的NginX设置发布到StackOverflow,但这也是非常重要的。
让Icecast听80和443端口要容易得多。然而,这需要一个专用的IP地址才能工作。
https://serverfault.com/questions/1115085
复制相似问题