By outstore2020
Hi everybody, I used two streaming’s servers which host many webradios streams (over 25). Each stream use a port between 8000 and 9000.
I have 3 servers : -> nginx load-balancer and reverse-proxy -> 2 streaming’s server (webradios) on ports between 3000 and 4000 .
I use Nginx to :
allow HTTPS for all webradios
change server on failure (ex.: server down). (high-availability / load-balance)
I’m trying to do something like this :
When user listen a stream on https://hosting.mydomain.com:8xxx , I want to transparently (proxify) send the request on one of the two Icecast’s server.
If HTTPS and Icecast_1 is alive then send the request to Icecast_1.
If HTTPS and Icecast_1 is down then send the request to Icecast_2.
This is the current configuration of Nginx:
#Streaming's cluster :
upstream backend {
ip_hash;
server 10.0.0.1 ;
server 10.0.0.2 ;
}
#SSL for all
server {
listen 8000-9000 ssl ;
server_name hosting.mydomain.com;
access_log /var/log/nginx/reverse-ssl-access.log;
error_log /var/log/nginx/reverse-ssl-error.log;
# ssl on;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1 ;
ssl_certificate /etc/letsencrypt/live/live.mydomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/live.mydomain.com/privkey.pem;
location / {
resolver 8.8.8.8;
proxy_pass http://backend:$server_port;
}
}
code
I try to do something like this : “http://backend:$server_port”.
In the web browser I’ve the error : 502 Bad gateway
In the errors logs on the server : *1 no resolver defined to resolve backend .
Can you help me ?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.