Redirect 301 in Nginx (images and dynamic pages)
===

I am changing my site address and I am having difficulty in two types of 301 redirects on the server Nginx. I've tried MANY ways to do this, but everything went wrong so far.

I want to change the:

    ^/downs/pafiledb.php?action=download&id=(NUMBER)

to other site:

    http://www.newsite.com/downloads/NUMBER

And also a problem with the redirect with the pictures, see below.

I want to change the entire folder to another site:

    ^/images/

to

    http://www.newsite.com/images/

How can I do this? I've tried every way possible in Nginx and nothing works.