Caddy run well via Firefox or Safari, but failed in Chrome and Opera

1. The problem I’m having:

My website with https runs very well in Firefox and Safari. If I use Firefox to browse my website, it runs successfully, when I use Windows 11, MAC, iPhone. But when I use Chrome, Edge or Opera in Windows 11, I can not open my website.

2. Error messages and/or full log output:

Below log is from Chrome with F12(Dev Tools).

host.abc.com/:10 
       GET https://host.abc.com/_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css net::ERR_TOO_MANY_REDIRECTS
host.abc.com/:15 
        
        
       GET https://host.abc.com/change-lepton-x.css net::ERR_TOO_MANY_REDIRECTS
host.abc.com/:16 
        
        
       GET https://host.abc.com/_content/Yee.Change.BrainUiV2.Blazor/app.css net::ERR_TOO_MANY_REDIRECTS
host.abc.com/:17 
        
        
       GET https://host.abc.com/favicon.ico net::ERR_TOO_MANY_REDIRECTS
Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1 [2023-11-09T01:43:42.162Z] Information: Normalizing '_blazor' to 'https://host.abc.com/_blazor'.
Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1 WebSocket connection to 'wss://host.abc.com/_blazor?id=ZYBQi_zBHrmdJGohFatuxA' failed: Error during WebSocket handshake: Unexpected response code: 308
(anonymous) @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
connect @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
_startTransport @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
_createTransport @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
_startInternal @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1 [2023-11-09T01:43:42.236Z] Information: (WebSockets transport) There was an error with the transport.
Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1 [2023-11-09T01:43:42.237Z] Error: Failed to start the transport 'WebSockets': Error: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.
log @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
_createTransport @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
await in _createTransport (async)
_startInternal @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
await in _startInternal (async)
start @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
_startInternal @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
_startWithStateTransitions @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
start @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
dr @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
ur @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
await in ur (async)
(anonymous) @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
(anonymous) @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1 [2023-11-09T01:43:42.365Z] Warning: Failed to connect via WebSockets, using the Long Polling fallback transport. This may be due to a VPN or proxy blocking the connection. To troubleshoot this, visit https://aka.ms/blazor-server-using-fallback-long-polling.
log @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
dr @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
await in dr (async)
ur @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
await in ur (async)
(anonymous) @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
(anonymous) @ Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1
ad_2022.jpg:1 
        
        
       GET https://host.abc.com/images/banner/ad_2022.jpg net::ERR_TOO_MANY_REDIRECTS
Blazor.LeptonXTheme.Global.68F3F68BE181896318B4F5A9EF1683C9.js?_v=638350482439245421:1 
        


3. Caddy version:

root@web004:~# caddy version
v2.7.5 h1:HoysvZkLcN2xJExEepaFHK92Qgs7xAiCFydN5x5Hs6Q=

4. How I installed and ran Caddy:

I install Caddy on Ubuntu 22.04 follow Caddy offical website, not in docker.

d. My complete Caddy config:

very simple, I use Caddy as a reverse proxy,

host.abc.com {
        reverse_proxy host.abc.com http://home.dynamicdomain.com:8080
        log /root/access.log
        tls zhongfang@email.com
}

5. Links to relevant resources:

nothing.

Please fill out the issue template completely and follow the instructions so we can help you.

Thank you very much! I encouted an error while I saved my first post in Caddy BBS. Now I completed my question. Hope your help.

Please follow the directions to use curl -v to make the request. What is the output of curl -v ... for your URLs? Maybe use -L in your case too.

If the redirects don’t happen in curl then it’s a browser caching bug.

This looks wrong. You have two arguments to reverse_proxy so Caddy will load balance between those two, and the first one will cause redirect loops because you’re proxying Caddy to itself. Remove host.abc.com there.

1 Like

Thank you very much. I have resolved my problem after remove host.abc.com.

I didn’t know that I am using load blance…
I copy config from answers from Bing. I am a newbie to Caddy.

Thanks a lot!
I have studied a new skill.

1 Like