103 reputation
2
bio website
location
age
visits member for 2 years, 11 months
seen Oct 9 at 14:34

Sep
24
awarded  Scholar
Sep
24
accepted nginx use rewrite as dynamic 404 image
Sep
24
comment nginx use rewrite as dynamic 404 image
Thanks. This is what i was looking for. I didn't know i could use regex backreferences from location blocks like this.
Sep
24
comment nginx use rewrite as dynamic 404 image
After a few more attempts, i used your answer and replaced error_page 404 $request_filename; with error_page 404 $uri; and that did the trick for me, but i have no idea why. Any ideas?
Sep
24
comment nginx use rewrite as dynamic 404 image
I have tried your solution, but i still get the default nginx 404 page. Possibly because $request_filename is the foo.jpg (unexisting image) url when used above the conditional and in the location block.
Sep
24
asked nginx use rewrite as dynamic 404 image
Jan
15
awarded  Supporter