I have an icecast server that runs on port 8000 however when I set up a proxy using NGINX I seem not to be able to make it look like it is the original server.
I am wondering is there anyway to kinda like make a NGINX that is parked and pointed at port 8000 but allow traffic from port 80
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/;
}
}
I have also tried
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;
}
}
however when I then try and connect to it via my Nodejs app it does not load when using the package var icecast = require('icecast-stack')
I know that plugin looks for icy-metaint
which is a header that icecast streams have.
From my understand my NGINX needs to pass that header
The headers I need to pass are they are from 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'