mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
split nginx.conf
This commit is contained in:
parent
b8abf790f2
commit
da952424ef
2
PKGBUILD
2
PKGBUILD
@ -54,7 +54,7 @@ md5sums=(SKIP)
|
||||
backup=(
|
||||
etc/kvmd/{override,logging,auth,meta}.yaml
|
||||
etc/kvmd/{ht,ipmi}passwd
|
||||
etc/kvmd/nginx/{loc-{login,nocache,proxy,websocket},mime-types,ssl,nginx}.conf
|
||||
etc/kvmd/nginx/{kvmd.ctx-{http,server},loc-{login,nocache,proxy,websocket},mime-types,ssl,nginx}.conf
|
||||
)
|
||||
|
||||
|
||||
|
||||
7
configs/nginx/kvmd.ctx-http.conf
Normal file
7
configs/nginx/kvmd.ctx-http.conf
Normal file
@ -0,0 +1,7 @@
|
||||
upstream kvmd {
|
||||
server unix:/run/kvmd/kvmd.sock fail_timeout=0s max_fails=0;
|
||||
}
|
||||
|
||||
upstream ustreamer {
|
||||
server unix:/run/kvmd/ustreamer.sock fail_timeout=0s max_fails=0;
|
||||
}
|
||||
95
configs/nginx/kvmd.ctx-server.conf
Normal file
95
configs/nginx/kvmd.ctx-server.conf
Normal file
@ -0,0 +1,95 @@
|
||||
absolute_redirect off;
|
||||
|
||||
index index.html;
|
||||
|
||||
auth_request /auth_check;
|
||||
|
||||
location = /auth_check {
|
||||
internal;
|
||||
proxy_pass http://kvmd/auth/check;
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /usr/share/kvmd/web;
|
||||
include /etc/kvmd/nginx/loc-login.conf;
|
||||
include /etc/kvmd/nginx/loc-nocache.conf;
|
||||
}
|
||||
|
||||
location @login {
|
||||
return 302 /login;
|
||||
}
|
||||
|
||||
location /login {
|
||||
root /usr/share/kvmd/web;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location /share {
|
||||
root /usr/share/kvmd/web;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location = /favicon.ico {
|
||||
alias /usr/share/kvmd/web/favicon.ico;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location = /robots.txt {
|
||||
alias /usr/share/kvmd/web/robots.txt;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location /api/ws {
|
||||
rewrite ^/api/ws$ /ws break;
|
||||
rewrite ^/api/ws\?(.*)$ /ws?$1 break;
|
||||
proxy_pass http://kvmd;
|
||||
include /etc/kvmd/nginx/loc-proxy.conf;
|
||||
include /etc/kvmd/nginx/loc-websocket.conf;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location /api/msd/write {
|
||||
rewrite ^/api/msd/write$ /msd/write break;
|
||||
rewrite ^/api/msd/write\?(.*)$ /msd/write?$1 break;
|
||||
proxy_pass http://kvmd;
|
||||
include /etc/kvmd/nginx/loc-proxy.conf;
|
||||
limit_rate 6250k;
|
||||
limit_rate_after 50k;
|
||||
client_max_body_size 0;
|
||||
proxy_request_buffering off;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location /api/log {
|
||||
rewrite ^/api/log$ /log break;
|
||||
rewrite ^/api/log\?(.*)$ /log?$1 break;
|
||||
proxy_pass http://kvmd;
|
||||
include /etc/kvmd/nginx/loc-proxy.conf;
|
||||
proxy_read_timeout 7d;
|
||||
postpone_output 0;
|
||||
proxy_buffering off;
|
||||
proxy_ignore_headers X-Accel-Buffering;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location /api {
|
||||
rewrite ^/api$ / break;
|
||||
rewrite ^/api/(.*)$ /$1 break;
|
||||
proxy_pass http://kvmd;
|
||||
include /etc/kvmd/nginx/loc-proxy.conf;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location /streamer {
|
||||
rewrite ^/streamer$ / break;
|
||||
rewrite ^/streamer\?(.*)$ ?$1 break;
|
||||
rewrite ^/streamer/(.*)$ /$1 break;
|
||||
proxy_pass http://ustreamer;
|
||||
include /etc/kvmd/nginx/loc-proxy.conf;
|
||||
postpone_output 0;
|
||||
proxy_buffering off;
|
||||
proxy_ignore_headers X-Accel-Buffering;
|
||||
}
|
||||
@ -18,9 +18,6 @@ http {
|
||||
default_type application/octet-stream;
|
||||
charset utf-8;
|
||||
|
||||
absolute_redirect off;
|
||||
index index.html;
|
||||
|
||||
sendfile on;
|
||||
tcp_nodelay on;
|
||||
tcp_nopush on;
|
||||
@ -33,14 +30,7 @@ http {
|
||||
scgi_temp_path /tmp/kvmd-nginx.scgi_temp;
|
||||
uwsgi_temp_path /tmp/kvmd-nginx.uwsgi_temp;
|
||||
|
||||
upstream kvmd {
|
||||
server unix:/run/kvmd/kvmd.sock fail_timeout=0s max_fails=0;
|
||||
}
|
||||
|
||||
upstream ustreamer {
|
||||
server unix:/run/kvmd/ustreamer.sock fail_timeout=0s max_fails=0;
|
||||
}
|
||||
|
||||
include /etc/kvmd/nginx/kvmd.ctx-http.conf;
|
||||
include /usr/share/kvmd/extras/*/nginx.ctx-http.conf;
|
||||
|
||||
#PROD server {
|
||||
@ -54,98 +44,7 @@ http {
|
||||
server_name localhost;
|
||||
#PROD include /etc/kvmd/nginx/ssl.conf;
|
||||
|
||||
auth_request /auth_check;
|
||||
|
||||
location = /auth_check {
|
||||
internal;
|
||||
proxy_pass http://kvmd/auth/check;
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /usr/share/kvmd/web;
|
||||
include /etc/kvmd/nginx/loc-login.conf;
|
||||
include /etc/kvmd/nginx/loc-nocache.conf;
|
||||
}
|
||||
|
||||
location @login {
|
||||
return 302 /login;
|
||||
}
|
||||
|
||||
location /login {
|
||||
root /usr/share/kvmd/web;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location /share {
|
||||
root /usr/share/kvmd/web;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location = /favicon.ico {
|
||||
alias /usr/share/kvmd/web/favicon.ico;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location = /robots.txt {
|
||||
alias /usr/share/kvmd/web/robots.txt;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location /api/ws {
|
||||
rewrite ^/api/ws$ /ws break;
|
||||
rewrite ^/api/ws\?(.*)$ /ws?$1 break;
|
||||
proxy_pass http://kvmd;
|
||||
include /etc/kvmd/nginx/loc-proxy.conf;
|
||||
include /etc/kvmd/nginx/loc-websocket.conf;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location /api/msd/write {
|
||||
rewrite ^/api/msd/write$ /msd/write break;
|
||||
rewrite ^/api/msd/write\?(.*)$ /msd/write?$1 break;
|
||||
proxy_pass http://kvmd;
|
||||
include /etc/kvmd/nginx/loc-proxy.conf;
|
||||
limit_rate 6250k;
|
||||
limit_rate_after 50k;
|
||||
client_max_body_size 0;
|
||||
proxy_request_buffering off;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location /api/log {
|
||||
rewrite ^/api/log$ /log break;
|
||||
rewrite ^/api/log\?(.*)$ /log?$1 break;
|
||||
proxy_pass http://kvmd;
|
||||
include /etc/kvmd/nginx/loc-proxy.conf;
|
||||
proxy_read_timeout 7d;
|
||||
postpone_output 0;
|
||||
proxy_buffering off;
|
||||
proxy_ignore_headers X-Accel-Buffering;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location /api {
|
||||
rewrite ^/api$ / break;
|
||||
rewrite ^/api/(.*)$ /$1 break;
|
||||
proxy_pass http://kvmd;
|
||||
include /etc/kvmd/nginx/loc-proxy.conf;
|
||||
auth_request off;
|
||||
}
|
||||
|
||||
location /streamer {
|
||||
rewrite ^/streamer$ / break;
|
||||
rewrite ^/streamer\?(.*)$ ?$1 break;
|
||||
rewrite ^/streamer/(.*)$ /$1 break;
|
||||
proxy_pass http://ustreamer;
|
||||
include /etc/kvmd/nginx/loc-proxy.conf;
|
||||
postpone_output 0;
|
||||
proxy_buffering off;
|
||||
proxy_ignore_headers X-Accel-Buffering;
|
||||
}
|
||||
|
||||
include /etc/kvmd/nginx/kvmd.ctx-server.conf;
|
||||
include /usr/share/kvmd/extras/*/nginx.ctx-server.conf;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user