haishanh / yacd

Yet Another Clash Dashboard
http://yacd.haishan.me
MIT License
4.16k stars 736 forks source link

sw.js 访问404问题; nginx prefix location路径 #768

Closed echoface closed 1 year ago

echoface commented 1 year ago

在使用nginx 通过prefix location 指向站点时, 报错访问有报错 sw.js 404( 原因是没有路径的prefix)

...
     location /yacd/ {

                alias /var/www/yacd/;

                autoindex on;
                autoindex_localtime on;
                autoindex_exact_size off;
                proxy_set_header X-Real-IP $remote_addr;
      }
....
iwestlin commented 1 year ago

我也遇到了…… 实际上这个问题已经修复了:https://github.com/haishanh/yacd/pull/753 但是readme给出的下载链接https://github.com/haishanh/yacd/archive/gh-pages.zip 是gh-pages分支的,那个分支并没有更新修复代码……

其实只需要改一个地方:把 index-3e6aad90.js 里的 const n="/sw.js" 改成 const n="./sw.js" 就好了

截屏2023-05-13 上午12 03 21
yaling888 commented 1 year ago

first fix #744

echoface commented 1 year ago

great job,thanks,