Nginx configuration rules for thinkphp configuration of secondary directories

current route rewriting rules

location / {
  if (!-e $request_filename) {
    rewrite   ^(.*)$ /index.php?s=$1 last;
    break;
  }
}

directory structure / data/wwwroot/default/

visit the website normally

add "abc", that is, / data/wwwroot/default/test. If you want the address www.abc.com/test/index.php to be accessible, how to configure it?

Apr.12,2022

location /test {
        rewrite  ^/test/(.*)$ /$1 break;
        proxy_pass https://www.xxx.com/;
     } 
Menu