-
-
Save Marfjeh/ca08b7ada00ec4896c25fad08db86651 to your computer and use it in GitHub Desktop.
nginx configuration for reverse-proxying icecast2 streaming server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name radio.example.com; | |
proxy_set_header Host $host; | |
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; | |
proxy_set_header X-Real-IP $remote_addr; | |
location / { | |
proxy_pass http://127.0.0.1:8000/; | |
subs_filter_types application/xspf+xml audio/x-mpegurl audio/x-vclt text/css text/html text/xml; | |
subs_filter ':8000/' '/' gi; | |
subs_filter '@localhost' '@example.com' gi; | |
subs_filter 'localhost' $host gi; | |
subs_filter 'Mount Point ' $host gi; | |
subs_filter '<h1 id="header">Icecast2 Status</h1><div id="menu"><ul><li><a href="admin/">Administration</a></li><li><a href="status.xsl">Server Status</a></li><li><a href="server_version.xsl">Version</a></li></ul></div>' '<!--<div id="menu"><ul><li><a href="admin/">Administration</a></li><li><a href="status.xsl">Server Status</a></li><li><a href="server_version.xsl">Version</a></li></ul></div>-->' gi; | |
location /admin/ { | |
deny all; | |
} | |
location /server_version.xsl { | |
deny all; | |
} | |
} | |
} | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name radio.internal.example.com; | |
proxy_set_header Host $host; | |
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; | |
proxy_set_header X-Real-IP $remote_addr; | |
location / { | |
proxy_pass http://127.0.0.1:8000/; | |
subs_filter_types application/xspf+xml audio/x-mpegurl audio/x-vclt text/css text/html text/xml; | |
subs_filter ':8000/' '/' gi; | |
subs_filter '@localhost' '@example.com' gi; | |
subs_filter 'localhost' $host gi; | |
subs_filter 'Mount Point ' $host gi; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment