|
楼主 |
发表于 2025-4-2 20:54:07
|
显示全部楼层
用这一段也行- location / {
8 n0 }' ~1 e9 b0 t/ o - if (-f $request_filename/index.html){
! { s, G, E) ]! y+ c5 L - rewrite (.*) $1/index.html break;
* e% K% A# H1 u- k2 _/ T, A - }0 b5 `) j+ s/ X; E( D% D2 x
- if (-f $request_filename/index.php){2 q M' J, { {
- rewrite (.*) $1/index.php;- O1 |' E& y) o7 C8 l. b9 m
- }, p2 J- w. V0 f5 W" P
- if (!-f $request_filename){
% K. V! C$ y% P& O' _* y/ w* p m - rewrite (.*) /index.php;
m. S8 F+ x( S- _ - }
6 h( F" e& l7 u- M' Y. D+ K - try_files $uri $uri/ =404;
# e' _- T% v; o- p+ W - }
复制代码 |
|