With NGiNX how can get a user to access a file on another server without redirection?

view story

http://serverfault.com – I have a server that is password protected, where I store files that I want my users to be able to access only if they have the rights. In the NGiNX configs I want to be able to do something like this: proxy_pass http://username:password@domain:80/ So that a user could go to this address: http://img.website.com/bob.jpg And then in the server the configs will point to this address: http://username:password@domain:80/bob.jpg Also is there a way to call a script (best would be PHP) to see if the person accessing the file as been logged in. My sessions are saved on another server (on a (HowTos)