URL
请求示例
curl http://example.com/path/to/image.jpg?size=320&v=1
变量解析
$scheme http
$uri /path/to/image.jpg
$args size=320&v=1
$request_uri /path/to/images.jpg?size=320&v=1
# HTTP 请求行
$request "GET /path/to/image.jpg?size=320&v=1 HTTP/1.1"
# 域名
$host example.com
$http_host example.com
有关于 $host 和 $http_host 区别,官方有以下说明:
$host
in this order of precedence: host name from the request line, or host name from the “Host” request header field, or the server name matching a request moreIn this configuration nginx tests only the request’s header field “Host” to determine which server the request should be routed to. If its value does not match any server name, or the request does not contain this header field at all, then nginx will route the request to the default server for this port. more