nginx_luci.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --- a/package/feeds/packages/nginx/files-luci-support/luci.locations
  2. +++ b/package/feeds/packages/nginx/files-luci-support/luci.locations
  3. @@ -1,11 +1,12 @@
  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_param SERVER_ADDR $server_addr;
  17. uwsgi_modifier1 9;
  18. --- a/package/network/services/dnsmasq/files/dnsmasq.init
  19. +++ b/package/network/services/dnsmasq/files/dnsmasq.init
  20. @@ -403,6 +403,20 @@ dhcp_this_host_add() {
  21. local routerstub routername ifdashname
  22. local lanaddr lanaddr6 lanaddrs6 ulaprefix
  23. +network_get_ipaddr lanaddr "lan"
  24. +if [ -n $lanaddr ]; then
  25. + echo "
  26. +$lanaddr op" >/tmp/hosts/shortcuts
  27. +if [ -f /etc/nginx/conf.d/shortcuts.conf ]; then
  28. +if [[ "$lanaddr" != "`grep "set \$ip" /etc/nginx/conf.d/shortcuts.conf | head -n1 | cut -f 3 -d " " | sed -e 's/;//'`" ]]; then
  29. + sed -i "/set $ip/c\set $ip \$lanaddr;" /etc/nginx/conf.d/shortcuts.conf
  30. + /etc/init.d/nginx reload
  31. +fi
  32. +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
  33. +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
  34. +fi
  35. +fi
  36. +
  37. if [ "$mode" -gt 0 ] ; then
  38. ifdashname="${ifname//./-}"
  39. routerstub="$( md5sum /etc/os-release )"
  40. --- a/package/feeds/packages/nginx/files/nginx.init
  41. +++ b/package/feeds/packages/nginx/files/nginx.init
  42. @@ -23,6 +23,10 @@ nginx_init() {
  43. rm -f "$(readlink "${UCI_CONF}")"
  44. ${NGINX_UTIL} init_lan
  45. + if [ ! -h "${UCI_CONF}" ]
  46. + then ln -sf /var/lib/nginx/uci.conf ${UCI_CONF}
  47. + fi
  48. +
  49. if [ -e "${UCI_CONF}" ]
  50. then CONF="${UCI_CONF}"
  51. else CONF="${NGINX_CONF}"