1、 use the scene
Enterprise platform docking city platform, city platform with http request real- time video;
The municipal platform is connected to the provincial platform, and the provincial platform uses https to request real- time video.
2、 operating instructions
2.1 edit nginx.conf and add the following code block
stream {
upstream http {
server 127.0.0.1:6604;
}
upstream https {
server 127.0.0.1:16604;
}
upstream http_palyback {
server 127.0.0.1:6617;
}
upstream https_palyback {
server 127.0.0.1:16617;
}
map $ssl_preread_protocol $upstream {
default http;
"TLSv1.2" https;
"TLSv1.3" https;
}
map $ssl_preread_protocol $upstream_playback {
default http_palyback;
"TLSv1.2" https_palyback;
"TLSv1.3" https_palyback;
}
server {
# Port for accessing the service
listen 26604;
proxy_pass $upstream;
ssl_preread on;
}
server {
# Port for accessing the service
listen 26617;
proxy_pass $upstream_playback;
ssl_preread on;
}
}
Description:
1. When the superior platform 26604 the port through http request, nginx will distribute the traffic to the 6604 port to realize the http address to watch video;
2. When the superior platform requests the 26604 port through https, nginx will distribute the traffic to the 16604 port to watch videos at https address;
3. Request history playback Similarly, other ports can be customized.
2.2 809 Forwarding Add the following configuration items
; 809 video request response and playback request response specify port
REALPLAYPORT=26604
PLAYBACKPORT=26617
3、 Precautions
note that it is necessary to enable relevant tcp port mapping, which is suitable for the latest forwarding plug- in for 7.34 version or above, see the attachment.