renbaoshuo / Shortlink

短链接生成网站源码
MIT License
102 stars 33 forks source link

[Bug]部分链接无法跳转 #2

Open Burial0268 opened 2 years ago

Burial0268 commented 2 years ago

如题,在生成了短链接后,有部分概率会导致访问404

配置:伪静态确认无误,nginx/tengine,php74

尝试解决:改目录权限,重新部署(均没用)

MTmin commented 1 year ago

重写伪静态规则为 location / { try_files $uri $uri/ =404; rewrite (\d+|\w+)$ /index.php?id=$1;

location ^~ /asset/ {
  root /var/www/crz.im;
}

location ^~ /api/ {
  root /var/www/crz.im;
}

location ^~ /inc/ {
  return 403;
}

} 即可