Так что в настоящее время у меня есть сервер, на котором работает nginx и shoutcast. Я бегу Ubuntu 16.04.4 LTS (GNU/Linux 3.13.0-52-generic x86_64)
.
Используя cloudflare, я связываю поддомен (используя запись A) с моим IP. Этот субдомен проксируется на mypi: 8000 для доступа к shoutcast verver, используя этот домен.
Теперь я получаю shoutcast простой IP-адрес на сервере для каждого подключенного клиента, поэтому каждый IP-адрес одинаков, и у меня не может быть уникальных слушателей.
Вот мой конфиг Nginx:
##
# Default server configuration
##
server {
listen 80;
listen [::]:80 default_server ipv6only=on;
listen 443 ssl http2;
ssl on;
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
root /usr/share/nginx/html;
index index.php index.html index.htm;
server_name rallypodium.be www.rallypodium.be;
if ($http_host = rallypodium.be){
rewrite (.*) https://www.rallypodium.be$1;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# pass the PHP scripts to FastCGI server listening on the php-fpm socket
location ~ \.php$ {
fastcgi_cache phpcache; # The name of the cache key-zone to use
fastcgi_cache_valid 200 30m; # What to cache: 'Code 200' responses, for half an hour
fastcgi_cache_methods GET HEAD; # What to cache: only GET and HEAD requests (not POST)
add_header X-Fastcgi-Cache $upstream_cache_status; # Add header so we can see if the cache hits or misses
try_files $uri $uri/ /index.php?$query_string;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
##############################################################
# SHOUTCAST SERVER CONFIGURATION
##############################################################
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
server_name stream.rallypodium.be;
location / {
proxy_pass http://serverip:8000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
serverIP - это тот же IP-адрес, на котором работает nginx. Так что "localhost" здесь ... Есть идеи? Я уже пытался добавить set_real_ip_from
со всеми Ip-адресами CF, а затем добавить real_ip_header CF-Connecting-IP;
, но это, похоже, не работает ...