域名是需要解析成IP,本地会优先查找本地解析表
C:\Windows\System32\drivers\etc\hosts
192.168.56.10 php.test.com
ping php.test.com
http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; gzip on; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; server { listen 80; server_name php.test.com; root html/test; index index.html index.php index.htm; access_log logs/${server_name}.access.log main; location / { } } }
http://php.test.com/