Excerpt from nginx rewrite module documentation:
If in the line of replacement arguments are indicated, then the rest of the request arguments are appended to them. To avoid having them appended, place a question mark as the last character:
rewrite ^/users/(.*)$ /show?user=$1? last;
Поместите маску вопроса в конце замены:
location ~ \.php$ {
location ~ /example\.php$ {
if ($args ~ var=value) {
rewrite ^ /? permanent;
}
}
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
fastcgi_intercept_errors on;
error_page 404 /error/404.php;
}
Самый простой способ, который я нашел, это:
rewrite ^ / example.php /? постоянный;
Спасибо всем.