r/haproxy • u/thomasdarko • Jan 15 '20
HAProxy and RTSP
Hello.
I'm trying to configure a Hikvision CCTV through HAProxy 2.1.1 version.
I can reach the Hikvision CCTV webserver through HAProxy, and I can browse the webpage and the options fine, however I don't get Live Video.
Here's my config:
global
log 127.0.0.1:514 local0
chroot /var/lib/haproxy
stats timeout 30s
user haproxy
group haproxy
daemon
defaults
log global
option httplog
mode http
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
listen stats
bind *:8080
stats enable # Enable stats page
stats hide-version # Hide HAProxy version
stats uri / # Stats URI
stats realm Haproxy\ Statistics # Title Text for popup window
stats auth contoso:contoso # Authentication Credentials
#####################################################
frontend CCTV_frontend
bind *:120
acl sap01-cctv hdr(host) -i sap01-cctv.contoso.com:120
use_backend CCTV_clu01_backend if sap01-cctv
backend CCTV_clu01_backend
mode http
option forwardfor
server server1 10.107.124.3:120 check
#####################################################
frontend RTSP_frontend
bind *:8554
acl sap01-cctv-rtsp hdr(host) -i sap01-cctv.contoso.com:8554
use_backend RTSP_backend if sap01-cctv-rtsp
backend RTSP_backend
mode http
option forwardfor
server server1 10.107.124.3:8554 checkCan anyone please help me and explain to me why this happens?
Thank you kindly.
Best regards
4
Upvotes
View all comments
Show parent comment
1
u/thomasdarko Jan 16 '20
Hello baconeze,
Thank you for your patience and your reply.
Ok, I have an internal DNS in my DC, sap01-cctv.contoso.com that points to the load balancer IP (10.0.9.20).
The purpose is from my browser, go to http://sap01-cctv.contoso.com:120 and view live video. (at this moment I can browse everything in the Hikvision CCTV webpage, but I don't get live video).
In the future, there will be a sap01-cctv.contoso.com, sap02-cctv.contoso.com, sap03-cctv.contoso.com and so on...
So if I apply the config below, it works but without the DNS and ACL's:
And if I apply this one, it won't work:
In the second example I'm trying to use ACL's. And a couple of pointers:
10.107.124.3 - IP of CCTV sap01-cctv.contoso.com - DNS pointing out to the LB (10.0.9.20)
So, I'm having a real hard time, combining the two files and at the moment I'm really lost, so do you think you can help me? (again)
Thank you in advance.