summaryrefslogtreecommitdiff
path: root/kvmd/configs/nginx/nginx.conf
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-07-08 01:31:11 +0000
committerDevaev Maxim <[email protected]>2018-07-08 01:31:11 +0000
commit09cccf0ffba8483923843352f855cf30ea68b550 (patch)
treed44c998a11acaba71ab6e4601ab414999962d11e /kvmd/configs/nginx/nginx.conf
parent8c9441e0a3e676b4f7e36b48da8589dd15b8d125 (diff)
moved main configs to kvmd package
Diffstat (limited to 'kvmd/configs/nginx/nginx.conf')
-rw-r--r--kvmd/configs/nginx/nginx.conf76
1 files changed, 76 insertions, 0 deletions
diff --git a/kvmd/configs/nginx/nginx.conf b/kvmd/configs/nginx/nginx.conf
new file mode 100644
index 00000000..05e07047
--- /dev/null
+++ b/kvmd/configs/nginx/nginx.conf
@@ -0,0 +1,76 @@
+user http;
+worker_processes 4;
+
+# error_log /tmp/nginx.error.log;
+error_log /dev/null crit;
+
+events {
+ worker_connections 64;
+ use epoll;
+}
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+ charset utf-8;
+
+ sendfile on;
+ keepalive_timeout 10;
+ # gzip on;
+
+ upstream kvmd {
+ 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;
+
+ listen 80;
+ server_name localhost;
+
+ client_body_temp_path /tmp/nginx.client_body_temp;
+ fastcgi_temp_path /tmp/nginx.fastcgi_temp;
+ proxy_temp_path /tmp/nginx.proxy_temp;
+ scgi_temp_path /tmp/nginx.scgi_temp;
+ uwsgi_temp_path /tmp/nginx.uwsgi_temp;
+
+ location / {
+ root /usr/share/kvmd/web;
+ index index.html;
+ }
+
+ location /kvmd/ws {
+ rewrite /kvmd/ws /ws break;
+ proxy_pass http://kvmd;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+ proxy_connect_timeout 7d;
+ proxy_send_timeout 7d;
+ proxy_read_timeout 7d;
+ }
+
+ location /kvmd/msd/write {
+ rewrite /kvmd/msd/write /msd/write break;
+ proxy_pass http://kvmd;
+ limit_rate 6250k;
+ limit_rate_after 50k;
+ client_max_body_size 0;
+ proxy_request_buffering off;
+ }
+
+ location /kvmd {
+ rewrite /kvmd/?(.*) /$1 break;
+ proxy_pass http://kvmd;
+ }
+
+ location /streamer {
+ rewrite /streamer/?(.*) /$1 break;
+ proxy_pass http://mjpg_streamer;
+ }
+ }
+}