I\'ve spent hours trying to solve this so I\'m posting as a last resort..
I\'ve tried removing some URL rewrites that were pointing a webpage from HTTP to HTTPS.
It seems that there is an output cache that caches the redirect response before it reaches the URL rewrite rules again. It can be turned off:
Be aware though that this is output cache for the whole application, so it might affect something else. In any case it can be utilized and then commented out to clean the state of url rewrite rules.