kiddin9 / Kwrt

一分钟在线定制编译 X86/64, NanoPi R2S R4S R5S R6S, 斐讯 Phicomm N1 K2P, 树莓派 Raspberry Pi, 香橙派 Orange Pi, 红米AX6, 小米AX3600, 小米AX9000, 红米AX6S 小米AX3200, 红米AC2100, 华硕ASUS, 网件NETGEAR 等主流软硬路由
https://openwrt.ai
MIT License
7.61k stars 3.04k forks source link

"Not Found" error in the latest version #1324

Closed edwin19861218 closed 1 year ago

edwin19861218 commented 1 year ago

Hello,

After upgrading the latest version, the nginx got response "Not Found" in all of the pages for luci. I checked the related nginx config and found it relevant for the process "uwsgi" in the file " /etc/nginx/conf.d/luci.locations". The request seems to be sent to uwsgi by nginx but got not found in response. Could you help me to check?

the luci.location file is:

location /luci { index index.html; include uwsgi_params; uwsgi_param SERVER_ADDR $server_addr; uwsgi_modifier1 9; uwsgi_pass unix:////var/run/luci-webui.socket; } location ~ /cgi-(backup|download|upload|exec) { include uwsgi_params; uwsgi_read_timeout 300s; uwsgi_param SERVER_ADDR $server_addr; uwsgi_modifier1 9; uwsgi_pass unix:////var/run/luci-cgi_io.socket; }

location ~ { include uwsgi_params; uwsgi_read_timeout 300s; uwsgi_param SERVER_ADDR $server_addr; uwsgi_modifier1 9; uwsgi_pass unix:////var/run/luci-cgi_io.socket; }

location /luci-static { error_log stderr crit; }

location /ubus { ubus_interpreter; ubus_socket_path /var/run/ubus/ubus.sock; ubus_parallel_req 2; }

location ~ ^/(.) { return 307 $scheme://$http_host/$1$is_args$args; }

location = / { return 301 $scheme://$http_host/luci/; }

And it seems to be right for uwsgi:

ps |grep uwsg 3424 root 2508 S /usr/sbin/uwsgi --ini /etc/uwsgi/emperor.ini 55823 root 3308 S /usr/sbin/uwsgi --set die-on-idle=true --ini /etc/uwsgi/vassals/luci-webui.ini 55824 root 3420 S /usr/sbin/uwsgi --set die-on-idle=true --ini /etc/uwsgi/vassals/luci-webui.ini 55893 root 1200 S grep uwsg

edwin19861218 commented 1 year ago

Seems to be related to relative path. Comment out the following lines in uci.conf and fix.

            #rewrite "^/$" $scheme://$http_host/luci/ permanent;
            #rewrite "^/cgi-bin/(.*)" $scheme://$http_host/$1 permanent;