302 Redirects to Upstream Servers Nginx

119 views
Skip to first unread message

Canlı TV

unread,
Dec 30, 2021, 4:11:53 PM12/30/21
to nginx-rtmp
I made a load balancer using Upstream. as follows.

```
*
*
*
   upstream appservers {
        least_conn;
        server srv1.domain.com:443;
        server srv2.domain.com:443;
    }
*
*
*
    server {
        listen 443 ssl http2;

        server_name domain.com:443;

        location /hls {        
                proxy_pass https://appservers/hls;
         }
    }
*
*
*
```

I set nginx.conf similar to above.

It's working fine now, but the main server domain.com:443 is heavily affected by live streams. How can I 302 forward this traffic to the edge servers?

So I want to direct every incoming request as a link to the end servers.

**domain.com/hls/test.m3u8 > srv1.domain.com/hls/test.m3u8**

**domain.com/hls/test.m3u8 > srv2.domain.com/hls/test.m3u8**

*
*

As. I want to distribute live streams to upstream servers.

Thanks.

Reply all
Reply to author
Forward
0 new messages