Success!
Thanks Vlad
i just changed the root to /var/www, and changed the rewrite tool to
Code:
rewrite ^/download/(\d+)/.*\.(.*)$ /opds/fetch.php?data=$1&type=$2 last;
and it just worked! I was changing the php location as well, which was probably screwing me up.