diff options
author | Devaev Maxim <[email protected]> | 2018-06-29 03:05:41 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-06-29 03:05:41 +0300 |
commit | 01f93b905a102804c888c5207154f1948375bfc8 (patch) | |
tree | ded016fdd93283fa2c3f6ed6c4c724b98971147d /os | |
parent | c1e8c2a024eb89fb3acaf8089e5843921a5fe4a7 (diff) |
improved nginx config
Diffstat (limited to 'os')
-rw-r--r-- | os/kvm/nginx.conf | 22 |
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; + } } } |