1. Caddy version (caddy version
):
v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=
2. How I run Caddy:
As a service: sudo systemctl start caddy
a. System environment:
Ubuntu 21.10
b. Command:
sudo systemctl start caddy
c. Service/unit/compose file:
n/a
d. My complete Caddyfile or JSON config:
http://localhost {
root * /var/www/html/php
php_fastcgi unix//run/php/php8.0-fpm.sock
file_server
encode gzip zstd
log {
output file /var/log/caddy/access.log {
roll_size 3MiB
roll_keep 5
roll_keep_for 48h
}
format console
}
encode gzip zstd
}
3. The problem Iâm having:
I am trying to access my website on my Ubuntu web server from a different PC on the network. I have verified that on the web server I can type curl -v localhost
and get the âHello Worldâ results I am looking for. So PHP is working correctly on the web server. On my second PC, I have tried the IP of the web server in the address bar and a domain name ecgoinc.localhost
after I added 192.168.0.100 ecgoinc.localhost
to my hosts file. It just says âunable to connectâ in the browser. Now I did just test curl from my second PC. curl -v 192.168.0.100
and got this result:
* Rebuilt URL to: 192.168.0.100/
* Trying 192.168.0.100...
* TCP_NODELAY set
* Connected to 192.168.0.100 (192.168.0.100) port 80 (#0)
> GET / HTTP/1.1
> Host: 192.168.0.100
> User-Agent: curl/7.55.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: Caddy
< Date: Mon, 22 Nov 2021 04:50:14 GMT
< Content-Length: 0
<
* Connection #0 to host 192.168.0.100 left intact
Maybe this is not a Caddy problem and maybe it is a just a setting in my network config. I know Iâm close, but stuck on how to get this to work.
4. Error messages and/or full log output:
After I did that curl from the second PC, I got this in the log file:
1.6375572635589192e+09 info http.log.access handled request {"request": {"remote_addr": "192.168.0.130:59446", "proto": "HTTP/1.1", "method": "GET", "host": "192.168.0.100", "uri": "/", "headers": {"User-Agent": ["curl/7.55.1"], "Accept": ["*/*"]}}, "common_log": "19
2.168.0.130 - - [22/Nov/2021:05:01:03 +0000] \"GET / HTTP/1.1\" 0 0", "user_id": "", "duration": 0.000013111, "size": 0, "status": 0, "resp_headers": {"Server": ["Caddy"]}}
5. What I already tried:
Changed the domain part of the caddyfile several times.