Closed ryo-manba closed 2 years ago
Hostにhogeを指定した場合、 server_name hoge
が使われる。
> curl localhost:8080 -H "Host: hoge" -v
* Trying ::1:8080...
* connect to ::1 port 8080 failed: Connection refused
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host:hoge
> User-Agent: curl/7.77.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Length: 4
< Date: Thu, 01 Sep 2022 18:06:19 GMT
<
* Connection #0 to host localhost left intact
hoge%
Hostにfugaを指定した場合、server_name fuga
が使われる。
> curl localhost:8080 -H "Host: fuga" -v
* Trying ::1:8080...
* connect to ::1 port 8080 failed: Connection refused
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host:fuga
> User-Agent: curl/7.77.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Length: 4
< Date: Thu, 01 Sep 2022 18:06:30 GMT
<
* Connection #0 to host localhost left intact
fuga%