Nginx Redirect Url containing "PHP"
The problem was in the rewrite.
I changed rewrite to return code 410, I think that I would do that instead return return 301 (permanent).
So, here is the code:
if ($request_uri ~ .*.php.*) {
return 410;
}
Now, nginx will return 4010 for all pages that that contain ".php" in anywhere in URL. My django site can live in peace now ;-)