The rewrite works fine except for jpg files. I suppose there is
a conflict between the two locations. It works if I comment out
the first location. I tried to invert locations or to add a
"break;" after the rewrite command or to replace "permanent"
with "last" or "break". Nothing does the trick.