improved nginx config

This commit is contained in:
Devaev Maxim 2018-06-29 03:05:41 +03:00
parent c1e8c2a024
commit 01f93b905a

View File

@ -18,6 +18,14 @@ http {
keepalive_timeout 10; keepalive_timeout 10;
# gzip on; # gzip on;
upstream kvm_ws {
server localhost:8081 fail_timeout=0s max_fails=0;
}
upstream mjpg_streamer {
server localhost:8082 fail_timeout=0s max_fails=0;
}
server { server {
# access_log /tmp/nginx.access.log; # access_log /tmp/nginx.access.log;
access_log off; access_log off;
@ -36,16 +44,16 @@ http {
index index.html; index index.html;
} }
location /video {
rewrite /video/?(.*) /$1 break;
proxy_pass http://localhost:8082;
}
location /kvm/ws { location /kvm/ws {
rewrite /kvm/ws/?(.*) /ws break; rewrite /kvm/ws /ws break;
proxy_pass http://localhost:8081; proxy_pass http://kvm_ws;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade"; proxy_set_header Connection "upgrade";
} }
location /video {
rewrite /video/?(.*) /$1 break;
proxy_pass http://mjpg_streamer;
}
} }
} }