summaryrefslogtreecommitdiff
path: root/os/kvm/nginx.conf
diff options
context:
space:
mode:
Diffstat (limited to 'os/kvm/nginx.conf')
-rw-r--r--os/kvm/nginx.conf22
1 files changed, 15 insertions, 7 deletions
diff --git a/os/kvm/nginx.conf b/os/kvm/nginx.conf
index b9b1631b..a236b085 100644
--- a/os/kvm/nginx.conf
+++ b/os/kvm/nginx.conf
@@ -18,6 +18,14 @@ http {
keepalive_timeout 10;
# 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 {
# access_log /tmp/nginx.access.log;
access_log off;
@@ -36,16 +44,16 @@ http {
index index.html;
}
- location /video {
- rewrite /video/?(.*) /$1 break;
- proxy_pass http://localhost:8082;
- }
-
location /kvm/ws {
- rewrite /kvm/ws/?(.*) /ws break;
- proxy_pass http://localhost:8081;
+ rewrite /kvm/ws /ws break;
+ proxy_pass http://kvm_ws;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
+
+ location /video {
+ rewrite /video/?(.*) /$1 break;
+ proxy_pass http://mjpg_streamer;
+ }
}
}