--- ez_main.vcl	2021-02-17 15:49:14.740561373 +0100
+++ ez_main.vcl	2021-02-17 15:49:59.951990644 +0100
@@ -173,6 +173,13 @@
         restart;
     }
 
+    // If we get here, we are still trying to fetch x-user-context-hash
+    // but the origin replied with a redirect.
+    // Let's redirect them to their original req.url
+    if (req.restarts == 0 && resp.status == 301 && req.http.x-fos-original-url) {
+          set resp.http.location = regsub(resp.http.location, "/_fos_user_context_hash", req.http.x-fos-original-url);
+    }
+
     // If we get here, this is a real response that gets sent to the client.
 
     // Remove the vary on user context hash, this is nothing public. Keep all
