nginx rewrite for drupal I have installed Nginx and I have a Drupal site installed in a sub folder.
I also have a directory in /drupalpath/sites/default/files/books/ that stored some PDF in it.
I configure my nginx like this:

location /drupalpath {
    rewrite ^/drupalpath/(.*)$ /drupalpath/index.php?q=$1 last;
}


and it works nice.
But my problem is that the PDFs in /drupalpath/sites/default/files/books/ affected this rule and when I click to download my books it send 404 Error because this rule.
My question is that how to fix it?
location ~ \.pdf$ {
  try_files $uri =404;
}