1. The problem I’m having:
Caddy webserver is refusing connections to my website, which is just a basic PHP script echoing phpinfo()
2. Error messages and/or full log output:
When navigating to my domain configured in Caddyfile
, I see this request error:
ERROR http.log.error dialing backend: dial tcp 127.0.0.1:9000: connect: connection refused
{"request": {"remote_ip": "127.0.0.1", "remote_port": "58885", "client_ip": "127.0.0.1", "proto": "HTTP/2.0", "method": "GET", "host": "inv.localhost", "uri": "/", "headers": {"Sec-Fetch-Mode": ["navigate"], "Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"], "Accept-Encoding": ["gzip, deflate, br"], "Upgrade-Insecure-Requests": ["1"], "Sec-Fetch-Dest": ["document"], "Sec-Fetch-Site": ["none"], "Sec-Fetch-User": ["?1"], "Te": ["trailers"], "User-Agent": ["Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0"], "Accept-Language": ["en-US,en;q=0.5"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "inv.localhost"}}, "duration": 0.00638229, "status": 502, "err_id": "4sxjdd84f", "err_trace": "reverseproxy.statusError (reverseproxy.go:1265)"}
3. Caddy version:
v2.7.5
4. How I installed and ran Caddy:
I installed via homebrew… brew install caddy
I run in the same directory as my Caddyfile: caddy run
a. System environment:
This is running on Macos 12.6 Monterey
d. My complete Caddy config:
inv.localhost {
root * /Users/nateschreiner/projects/test/
php_fastcgi 127.0.0.1:9000
file_server
}