Users experience a continuous 307 redirect loop when accessing URLs that require authentication through a second realm, after already having authenticated through a first realm. The loop occurs at the virtual host URL configured for form-based or origin-redirect authentication.
The policy trace shows:
authentication status='invalid_surrogate'
Last Error: The surrogate is invalid for the specified realm.
verdict: REDIRECT(authentication_redirect_to_virtual_host)
client.response.code: 307
The browser is redirected repeatedly to the virtual host URL but the authentication form is never presented, or credentials are submitted but the loop continues. The issue only occurs with HTTPS traffic (HTTP/2 connections); HTTP traffic or environments where HTTP/2 is disabled are not affected.
All of the following conditions must be true to trigger the issue:
REALM_A for general traffic and REALM_B for a specific URL category such as shopping or social networking).SGOS 7.3.28.2 and later, and all 7.4.x releases
HTTP/2 multiplexes multiple request streams over a single TCP connection. Because many streams can be active simultaneously on one connection, the authentication subsystem faces inherent difficulty in accurately tracking which user is authenticated in which realm for each individual stream at any given moment. Unlike HTTP/1.1 — where each connection carries exactly one request at a time — H2 allows concurrent in-flight requests that may belong to different authentication contexts, making it challenging to maintain a consistent, per-stream view of realm membership across the auth subsystem.
This difficulty is compounded when both realms share the same virtual host address and port. An HTTP/2 client reuses its existing H2 connection for the VH redirect (RFC 7540 §9.1.1 connection coalescing), so the VH visit arrives over the same connection (and the same pool of concurrent streams) as the original request. The auth subsystem is therefore unable to cleanly isolate the incoming VH authentication attempt from the already-active streams, and the cross-realm transition is not handled correctly. The result is that the user is redirected back to the original URL without ever being presented with an authentication challenge, and the cycle repeats.
On HTTP/1.1, each VH visit opens a new TCP connection. There is only ever one request in flight on that connection, so realm context is unambiguous and the transition is handled correctly.
Configure the virtual host on a dedicated IP address or port that is separate from the address and port through which normal proxy traffic flows. This forces the client browser to open a new connection to the VH, preventing H2 connection coalescing. Configure that dedicated listener to refuse H2 (accept connections as HTTP/1.1 only), ensuring each VH authentication request gets its own isolated session.
The workaround involves three steps: network configuration, proxy service configuration, and policy.
Use the following procedures to configure a dedicated virtual host and prevent the redirect loop.
The VH address must differ from the address on which normal proxy traffic arrives, in either IP address or port number. Two options are available:
Option A: Different IP address (recommended if additional IPs are available)
Add a secondary IP address to the appliance network interface. The exact command depends on the interface name shown by show interface:
interface <interface-name>
ip-address <new-VH-IP> <subnet-mask>
exit
Example:
interface eth0
ip-address 192.168.77.81 255.255.255.0
exit
Option B: Different port on the same IP address
If a second IP is not available, use a different port (for example, 9443). Note that this port must be reachable from clients. Verify that any firewall between the client and the appliance permits traffic on the new port.
The Edge SWG appliance does not automatically create an HTTPS Reverse Proxy service. One must be created for the dedicated VH address.
From the Admin Console, perform the following steps:
Change the virtual-url on every realm that was sharing the old VH address to use the new dedicated address. All realms may point to the same dedicated VH address; they do not require separate addresses from each other.
From the Management Console, navigate to Configuration > Authentication, select each realm, and update the Virtual URL field:
Option A (different IP, same port):
virtual-url = https://192.168.77.81
Option B (same IP, different port):
virtual-url = https://192.168.77.80:9443
To verify the change took effect:
show authentication realm REALM_A
show authentication realm REALM_B
Both should show the updated virtual-url.
Add the following to the <Proxy> policy layer. This disables HTTP/2 acceptance on connections arriving at the dedicated VH address, ensuring all VH authentication connections use HTTP/1.1.
Option A (different IP, port 443):
<Proxy>
proxy.address=192.168.77.81 http2.client.accept(no)
Option B (same IP, different port):
<Proxy>
proxy.address=192.168.77.80 proxy.port=9443 http2.client.accept(no)
Notes on this policy:
After applying all changes, perform the following steps to verify the configuration in the Admin Console:
show authentication realm REALM_A
show authentication realm REALM_B
If adding a dedicated VH address is not feasible, HTTP/2 can be disabled globally for all client-side connections. This eliminates the problem entirely at the cost of disabling H2 for all proxy traffic.
<Proxy>
http2.client.accept(no)
Note: This is a blunt instrument. All HTTPS connections through the proxy will negotiate HTTP/1.1 instead of HTTP/2, which may reduce performance for sites and clients that benefit from H2 multiplexing. Remove this policy line once a permanent code fix is available.