there is no bug in location ~* ^.+\.(jpg|jpeg|gif)$ but location ~* \.(gif|jpg|jpeg)$ is simpler and better