packages/net/nginx/files-luci-support/60_nginx-luci-support
Peter Stadler 2401fd6db5 nginx: use /etc/nginx/nginx.conf enabling conf.d/
Instead of the default nginx.conf file this file is a small variant
without examples that enables the /etc/nginx/conf.d/ directory.

It will pull in all configuration files from the conf.d directory.
So, other packages can add their server parts in the conf.d directory
without modifying the main nginx.conf file (cf. ).

Changed also the default logging behavior:
	error_log stderr; # the init forwards it to logd
	access_log off;

See the updated documentation at:
https://openwrt.org/docs/guide-user/services/webserver/nginx

Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
2020-01-28 12:24:55 +01:00

38 lines
741 B
Bash

#!/bin/sh
if nginx -V 2>&1 | grep -q ubus; then
if [ -z "$(cat /etc/nginx/conf.d/luci.locations | grep ubus)" ]; then
cat <<EOT >> /etc/nginx/conf.d/luci.locations
location /ubus {
ubus_interpreter;
ubus_socket_path /var/run/ubus.sock;
ubus_parallel_req 2;
}
EOT
fi
fi
if [ -x /etc/init.d/uhttpd ]; then
/etc/init.d/uhttpd disable
if [ -n "$(pgrep uhttpd)" ]; then
/etc/init.d/uhttpd stop
fi
fi
/etc/init.d/nginx enable
if [ -n "$(pgrep nginx)" ]; then
/etc/init.d/nginx restart
else
/etc/init.d/nginx start
fi
/etc/init.d/uwsgi enable
if [ -n "$(pgrep uwsgi)" ]; then
/etc/init.d/uwsgi restart
else
/etc/init.d/uwsgi start
fi
exit 0