diff --git a/net/nginx/files-luci-support/60_nginx-luci-support b/net/nginx/files-luci-support/60_nginx-luci-support index 1a4f558d4..d1d01af15 100644 --- a/net/nginx/files-luci-support/60_nginx-luci-support +++ b/net/nginx/files-luci-support/60_nginx-luci-support @@ -1,8 +1,8 @@ #!/bin/sh if nginx -V 2>&1 | grep -q ubus; then - if [ -z "$(cat /etc/nginx/conf.d/luci.locations | grep ubus)" ]; then - cat <> /etc/nginx/conf.d/luci.locations + if [ -z "$(cat /etc/nginx/conf.d/luci.locations | grep ubus)" ]; then + cat <> /etc/nginx/conf.d/luci.locations location /ubus { ubus_interpreter; @@ -13,16 +13,23 @@ location /ubus { location ~ ^/ttyd(.*)$ { proxy_http_version 1.1; proxy_set_header Upgrade \$http_upgrade; + proxy_read_timeout 300s; + proxy_connect_timeout 75s; proxy_set_header Connection "upgrade"; proxy_pass http://\$server_addr:7681/\$1; } +location ~ /netdata/(?.*) { + proxy_http_version 1.1; + proxy_pass http://$server_addr:19999/$ndpath$is_args$args; +} + EOT - fi + fi fi grep -q /var/run/ubus.sock /etc/nginx/conf.d/luci.locations && - sed -i 's#/var/run/ubus.sock#/var/run/ubus/ubus.sock#' /etc/nginx/conf.d/luci.locations + sed -i 's#/var/run/ubus.sock#/var/run/ubus/ubus.sock#' /etc/nginx/conf.d/luci.locations if [ -x /etc/init.d/uhttpd ]; then /etc/init.d/uhttpd disable @@ -46,4 +53,4 @@ else fi -exit 0 +exit 0 \ No newline at end of file