script: update nginx configurations

This commit is contained in:
th33xitus
2021-07-10 09:22:43 +02:00
parent d3726733e5
commit 4d7e10e5c3
3 changed files with 33 additions and 6 deletions

View File

@@ -14,7 +14,7 @@ server {
gzip_comp_level 4;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/xml;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/xml application/javascript;
# web_path from <<UI>> static files
root /home/pi/<<UI>>;
@@ -56,6 +56,18 @@ server {
}
location /webcam/ {
proxy_pass http://mjpgstreamer/;
proxy_pass http://mjpgstreamer1/;
}
location /webcam2/ {
proxy_pass http://mjpgstreamer2/;
}
location /webcam3/ {
proxy_pass http://mjpgstreamer3/;
}
location /webcam4/ {
proxy_pass http://mjpgstreamer4/;
}
}

View File

@@ -1,13 +1,25 @@
# /etc/nginx/conf.d/upstreams.conf
upstream apiserver {
#edit your api port here
ip_hash;
server 127.0.0.1:7125;
}
upstream mjpgstreamer {
#edit your webcam port here
upstream mjpgstreamer1 {
ip_hash;
server 127.0.0.1:8080;
}
upstream mjpgstreamer2 {
ip_hash;
server 127.0.0.1:8081;
}
upstream mjpgstreamer3 {
ip_hash;
server 127.0.0.1:8082;
}
upstream mjpgstreamer4 {
ip_hash;
server 127.0.0.1:8083;
}