Thanks, but that was not it.
I decided to remove all lines one by one and then add them again one by one. And the problem is with the lines:
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
Header set imagetoolbar "no" env=ie
When I remove those it works again.
So now I have to figure out why those would trigger a 500?