当文件夹已经重写时,NGINX重写子文件夹?

时间:2016-01-27 09:58:28

标签: regex nginx rewrite

我有

/site/clients/anything

重写

/site/clients/index.php?action=$1

但是我也想重写

/site/clients/verify/anything

/site/clients/verify/index.php?VID=$1

我尝试过的事情

location / {
    try_files $uri $uri/ @extensionless-php;
    rewrite ^/site/clients/verify/(.+)$ /site/clients/verify/index.php?VID=$1;
    rewrite ^/site/clients/^(?!login|sign-up|verify\/.*$).*$ /site/clients/index.php?action=$1;
    index index.php index.html;
}

location ~ /site/clients/verify/(.+)$ {
    rewrite ^/site/clients/verify/(.+)$ /site/clients/verify/index.php?VID=$1;
}

location ~ /site/clients/^(?!login|sign-up|verify\/.*$).*$ {
    rewrite ^/site/clients/^(?!login|sign-up|verify\/.*$).*$ /site/clients/index.php?action=$
}

location ~ /site/clients/^((?!login|sign-up|verify).)*$ {
   rewrite /site/clients/^((?!login|sign-up|verify).)*$ /site/clients/index.php?action=$1;
}

这甚至可能吗? 没有任何进展。

0 个答案:

没有答案