From 41020f1f7eb87ddcb07e350e8e8722d61b22da52 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 4 Dec 2023 02:50:24 +0200 Subject: [PATCH] integrate somafm.com --- nginx/_todo/soma.fm | 43 --------------- nginx/somafm.com/yggwave/somafm.com/README.md | 35 ++++++++++++ .../yggwave/somafm.com/location.conf | 55 +++++++++++++++++++ .../somafm.com/yggwave/somafm.com/server.conf | 15 +++++ 4 files changed, 105 insertions(+), 43 deletions(-) delete mode 100644 nginx/_todo/soma.fm create mode 100644 nginx/somafm.com/yggwave/somafm.com/README.md create mode 100644 nginx/somafm.com/yggwave/somafm.com/location.conf create mode 100644 nginx/somafm.com/yggwave/somafm.com/server.conf diff --git a/nginx/_todo/soma.fm b/nginx/_todo/soma.fm deleted file mode 100644 index 5fbee24..0000000 --- a/nginx/_todo/soma.fm +++ /dev/null @@ -1,43 +0,0 @@ -# Stream mirrors for https://somafm.com/ - -server { - - # HTTP/IPv6 connections only - # listen [::]:80 ipv6only=on; - - # Yggdrasil connections only - # allow 0200::/7; - # deny all; - - # Tell to server, that's proxy request - # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Real-IP $remote_addr; - - location /soma.fm/suburbsofgoa/128/mp3 { - proxy_pass http://ice6.somafm.com/suburbsofgoa-128-mp3; - } - - location /soma.fm/thetrip/128/mp3 { - proxy_pass http://ice5.somafm.com/thetrip-128-mp3; - } - - location /soma.fm/thistle/128/mp3 { - proxy_pass http://ice4.somafm.com/thistle-128-mp3; - } - - location /soma.fm/cliqhop/128/mp3 { - proxy_pass http://ice6.somafm.com/cliqhop-128-mp3; - } - - location /soma.fm/lush/128/mp3 { - proxy_pass http://ice6.somafm.com/lush-128-mp3; - } - - location /soma.fm/deepspaceone/128/mp3 { - proxy_pass http://ice6.somafm.com/deepspaceone-128-mp3; - } - - location /soma.fm/sonicuniverse/128/mp3 { - proxy_pass http://ice6.somafm.com/sonicuniverse-128-mp3; - } -} \ No newline at end of file diff --git a/nginx/somafm.com/yggwave/somafm.com/README.md b/nginx/somafm.com/yggwave/somafm.com/README.md new file mode 100644 index 0000000..e5bf5bd --- /dev/null +++ b/nginx/somafm.com/yggwave/somafm.com/README.md @@ -0,0 +1,35 @@ +# Nginx proxy configuration for /yggwave/somafm.com subfolder location + +## Install + +This is subfolder configuration, use `server.conf` preset only when `default_server` not defined in your system: + +* `ln -s /etc/yggbro/nginx/somafm.com/yggwave/somafm.com/server.conf /etc/nginx/sites-enabled/yggbro.somafm.com.yggwave.somafm.com.conf` + +Alternatively, add following line to existing `default_server`: + +``` +include /etc/yggbro/nginx/somafm.com/yggwave/somafm.com/location.conf; +``` + +Test configuration and apply changes + +* `nginx -t` +* `service nginx reload` + +## Uninstall + +Remove symlink if exists: + +* `rm /etc/nginx/sites-enabled/yggbro.somafm.com.yggwave.somafm.com.conf` + +Remove following line from existing `default_server`: + +``` +include /etc/yggbro/nginx/somafm.com/yggwave/somafm.com/location.conf; +``` + +Test configuration and apply changes + +* `nginx -t` +* `service nginx reload` \ No newline at end of file diff --git a/nginx/somafm.com/yggwave/somafm.com/location.conf b/nginx/somafm.com/yggwave/somafm.com/location.conf new file mode 100644 index 0000000..734c6cd --- /dev/null +++ b/nginx/somafm.com/yggwave/somafm.com/location.conf @@ -0,0 +1,55 @@ +location /yggwave/somafm.com/suburbsofgoa/128/mp3 { + + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + + proxy_pass http://ice6.somafm.com/suburbsofgoa-128-mp3; +} + +location /yggwave/somafm.com/thetrip/128/mp3 { + + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + + proxy_pass http://ice5.somafm.com/thetrip-128-mp3; +} + +location /yggwave/somafm.com/thistle/128/mp3 { + + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + + proxy_pass http://ice4.somafm.com/thistle-128-mp3; +} + +location /yggwave/somafm.com/cliqhop/128/mp3 { + + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + + proxy_pass http://ice6.somafm.com/cliqhop-128-mp3; +} + +location /yggwave/somafm.com/lush/128/mp3 { + + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + + proxy_pass http://ice6.somafm.com/lush-128-mp3; +} + +location /yggwave/somafm.com/deepspaceone/128/mp3 { + + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + + proxy_pass http://ice6.somafm.com/deepspaceone-128-mp3; +} + +location /yggwave/somafm.com/sonicuniverse/128/mp3 { + + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + + proxy_pass http://ice6.somafm.com/sonicuniverse-128-mp3; +} \ No newline at end of file diff --git a/nginx/somafm.com/yggwave/somafm.com/server.conf b/nginx/somafm.com/yggwave/somafm.com/server.conf new file mode 100644 index 0000000..5d6dff5 --- /dev/null +++ b/nginx/somafm.com/yggwave/somafm.com/server.conf @@ -0,0 +1,15 @@ +server { + + # HTTP/IPv6 connections only + listen [::]:80 default_server; # make sure default_server not exists or throw an exception + + # Yggdrasil connections only + allow 0200::/7; + deny all; + + # Listen defaults + server_name _; + + # Include available locations + include /etc/yggbro/nginx/somafm.com/yggwave/somafm.com/location.conf; +}