mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
improved nginx config
This commit is contained in:
parent
c1e8c2a024
commit
01f93b905a
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user