Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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, nginx will proxy them

If I was to just use this line in my config file:
proxy_pass;, then they would have to append the .png themselves.

share|improve this question
up vote 2 down vote accepted

You could combine proxy_pass with a rewrite directive:

rewrite /([^/]+) /$1.png break;
share|improve this answer
This didn't quite work but after some experimentation I found this was fine: rewrite /(.*) /u/70152/screenshots/$1.png break; proxy_pass; – 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. – Dmitri Chubarov Jun 16 '12 at 14:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.