after 5 hours of struggle I finally found out that it wasn’t PHP or nginx, but CloudFlare messing with my website.
I just found out this is caused by RocketLoader. Why is that? I can’t imagine that is wanted behavior. I have disabled CloudFlare again for now.