Detect socket disconnects correctly.
Add separate locations for images and html content, so that
they can be cached separately.