nginx_luci.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. --- a/package/feeds/packages/nginx/files-luci-support/luci.locations
  2. +++ b/package/feeds/packages/nginx/files-luci-support/luci.locations
  3. @@ -1,12 +1,14 @@
  4. -location /cgi-bin/luci {
  5. +location /luci {
  6. index index.html;
  7. include uwsgi_params;
  8. + uwsgi_read_timeout 300s;
  9. uwsgi_param SERVER_ADDR $server_addr;
  10. uwsgi_modifier1 9;
  11. uwsgi_pass unix:////var/run/luci-webui.socket;
  12. }
  13. -location ~ /cgi-bin/cgi-(backup|download|upload|exec) {
  14. +location ~ /cgi-(backup|download|upload|exec) {
  15. include uwsgi_params;
  16. + uwsgi_read_timeout 300s;
  17. uwsgi_param SERVER_ADDR $server_addr;
  18. uwsgi_modifier1 9;
  19. uwsgi_pass unix:////var/run/luci-cgi_io.socket;
  20. --- a/package/network/services/dnsmasq/files/dnsmasq.init
  21. +++ b/package/network/services/dnsmasq/files/dnsmasq.init
  22. @@ -403,6 +403,20 @@ dhcp_this_host_add() {
  23. local routerstub routername ifdashname
  24. local lanaddr lanaddr6 lanaddrs6 ulaprefix
  25. +network_get_ipaddr lanaddr "lan"
  26. +if [ -n $lanaddr ]; then
  27. + echo "
  28. +$lanaddr op" >/tmp/hosts/shortcuts
  29. +if [ -f /etc/nginx/conf.d/shortcuts.conf ]; then
  30. +if [[ "$lanaddr" != "`grep "set \$ip" /etc/nginx/conf.d/shortcuts.conf | head -n1 | cut -f 3 -d " " | sed -e 's/;//'`" ]]; then
  31. + sed -i "/set \$ip/c\set \$ip $lanaddr;" /etc/nginx/conf.d/shortcuts.conf
  32. + /etc/init.d/nginx reload
  33. +fi
  34. +cat /etc/nginx/conf.d/shortcuts.conf | tr "\n" "\r" |grep -oE 'server_name [a-z.-]*;[^;]*set \$ip [0-9.]*;' | sed -e 's/server_name \(.*\);.*location.*set $ip \(.*\);/\2 \1/' >>/tmp/hosts/shortcuts
  35. +cat /etc/nginx/conf.d/shortcuts.conf | tr "\n" "\r" |grep -oE 'server_name [a-z.-]*;[^;]*return 301 \$scheme://op' | sed -e 's/server_name \(.*\?\);.*/\1/' | sed -e "s/^/$lanaddr /">>/tmp/hosts/shortcuts
  36. +fi
  37. +fi
  38. +
  39. if [ "$mode" -gt 0 ] ; then
  40. ifdashname="${ifname//./-}"
  41. routerstub="$( md5sum /etc/os-release )"
  42. --- a/package/feeds/packages/nginx/files/nginx.init
  43. +++ b/package/feeds/packages/nginx/files/nginx.init
  44. @@ -23,6 +23,10 @@ nginx_init() {
  45. rm -f "$(readlink "${UCI_CONF}")"
  46. ${NGINX_UTIL} init_lan
  47. + if [ ! -h "${UCI_CONF}" ]
  48. + then ln -sf /var/lib/nginx/uci.conf ${UCI_CONF}
  49. + fi
  50. +
  51. if [ -e "${UCI_CONF}" ]
  52. then CONF="${UCI_CONF}"
  53. else CONF="${NGINX_CONF}"