1

I've read through the documentation for nginx's HttpProxyModule, but I can't figure this out:

I want it so that if someone visits, for example http://ss.example.com/1339850978, nginx will proxy them http://dl.dropbox.com/u/xxxxx/screenshots/1339850978.png.

If I was to just use this line in my config file:
proxy_pass http://dl.dropbox.com/u/xxxxx/screenshots/;, then they would have to append the .png themselves.

1 Answer 1

2

You could combine proxy_pass with a rewrite directive:

rewrite /([^/]+) /$1.png break; proxy_pass http://dl.dropbox.com/u/xxxxx/screenshots/; 
2
  • 1
    This didn't quite work but after some experimentation I found this was fine: rewrite /(.*) /u/70152/screenshots/$1.png break; proxy_pass http://dl.dropbox.com/; Commented Jun 16, 2012 at 14:27
  • @DavidRobertson, I am sorry it did not work. will try to fix it as soon as I can get to test the rules. Thank you for the points. Commented Jun 16, 2012 at 14:33

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.