Localhost on OSX works in Chrome, but not Safari

1. The problem I’m having:

Caddy works as expected on Chrome, but “hangs” on Safari.

2. Error messages and/or full log output:

There is no specific error message, but when I try to query the URL (that works in Chrome) in the terminal, I am seeing a 404. The other interesting thing is the server is set as Caddy

curl -I https://scottw.localhost/articles/hash-new/
HTTP/2 404 
alt-svc: h3=":443"; ma=2592000
content-type: text/html
server: Caddy
content-length: 11121
date: Fri, 14 Apr 2023 19:15:25 GMT

3. Caddy version:

Version: v2.6.0 h1:lHDynvM+sTOi9Aq4Y15b4FtkqzPB36WbUrZvVdwzTCA=

4. How I installed and ran Caddy:

Caddy was installed via Homebrew

brew install caddy

a. System environment:

OS X Ventura 13.3
M1 Mac

b. Command:

brew services restart caddy

d. My complete Caddy config:

scottw.localhost:443 {
  reverse_proxy http://localhost:4001

In pretty sure Chrome and curl both have built in resolving for *.localhost to, but Safari may not. You might need to update your hosts file to make the system resolver handle your localhost subdomain.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.