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.

Wesley
  • 32,690
  • 9
  • 82
  • 117

1 Answers1

2

You could combine proxy_pass with a rewrite directive:

rewrite /([^/]+) /$1.png break;
proxy_pass http://dl.dropbox.com/u/xxxxx/screenshots/;
Dima Chubarov
  • 2,316
  • 1
  • 17
  • 28
  • 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/;` – David Robertson Jun 16 '12 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. – Dima Chubarov Jun 16 '12 at 14:33