我有一个网站的 2 个副本。它们使用相同的重写规则。其中一个站点是另一个站点中的子目录。我想知道如何让 nginx 检查我们是否要进入子目录并在尝试使用通用规则之前使用这些规则
这是我的 nginx.conf
location /rock/ {
      rewrite ^/(|/)$ /rock/index.php?request=$1;
      rewrite ^/([a-zA-Z0-9/_-]+)(|)$ /rock/index.php?request=$1;  
    }
location / {
      rewrite ^/(|/)$ /index.php?request=$1;
      rewrite ^/([a-zA-Z0-9/_-]+)(|)$ /index.php?request=$1;  
    }