We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请求相关变量:
$args
$content_length
$content_type
$request_method
$request_uri
$remote_addr
$remote_port
$scheme
$server_protocol
$http_USER_AGENT
$http_COOKIE
响应相关变量:
$status
$sent_http_HEADER
$sent_http_Content-Type
Content-Type
服务器相关变量:
$host
$server_name
$server_addr
$server_port
时间相关变量:
$time_iso8601
$time_local
连接相关变量:
$connection
$connection_requests
请求头部变量:
$http_HEADER
HEADER
$http_User-Agent
User-Agent
响应头部变量:
客户端请求主体长度变量:
$request_length
客户端请求主体类型变量:
$request_content_type
请求时间变量:
$request_time
响应时间变量:
$upstream_response_time
远程用户变量:
$remote_user
请求和响应字节数变量:
$bytes_sent
http { upstream default_backend { server 192.168.1.100:80; } upstream version1.0_backend { server 192.168.1.101:80; } upstream version2.0_backend { server 192.168.1.102:80; } map $http_cookie $backend { "~version=1\.0" version1.0_backend; "~version=2\.0" version2.0_backend; default default_backend; } server { listen 80; server_name example.com; location / { proxy_pass http://$backend; } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
nginx变量
请求相关变量:
$args
:获取请求中的参数字符串。$content_length
:获取请求主体的长度。$content_type
:获取请求主体的类型。$request_method
:获取HTTP请求方法(例如,GET、POST等)。$request_uri
:获取完整的HTTP请求URI(不包含主机和协议部分)。$remote_addr
:获取客户端的IP地址。$remote_port
:获取客户端的端口号。$scheme
:获取请求使用的协议(例如,http或https)。$server_protocol
:获取请求的HTTP协议版本。$http_USER_AGENT
:获取客户端的User-Agent头部信息。$http_COOKIE
:获取请求头部中的Cookie信息。响应相关变量:
$status
:获取HTTP响应的状态码。$sent_http_HEADER
:获取发送到客户端的响应头部信息。例如,$sent_http_Content-Type
获取Content-Type
头部的值。$content_length
:获取发送到客户端的响应主体长度。服务器相关变量:
$host
:获取请求中的主机名。$server_name
:获取匹配请求的服务器名。$server_addr
:获取服务器的IP地址。$server_port
:获取服务器监听的端口号。时间相关变量:
$time_iso8601
:获取ISO 8601格式的当前时间。$time_local
:获取访问时间的本地时间。连接相关变量:
$connection
:获取当前连接的序列号。$connection_requests
:获取当前连接已处理的请求数量。请求头部变量:
$http_HEADER
:获取请求头部中名为HEADER
的头部信息。例如,$http_User-Agent
获取User-Agent
头部的值。$http_COOKIE
:获取请求头部中的Cookie信息。响应头部变量:
$sent_http_HEADER
:获取发送到客户端的响应头部信息。例如,$sent_http_Content-Type
获取Content-Type
头部的值。客户端请求主体长度变量:
$request_length
:获取请求主体的长度。客户端请求主体类型变量:
$request_content_type
:获取请求主体的类型。请求时间变量:
$request_time
:获取从读取客户端请求的第一个字节到发送最后一个响应字节的时间。响应时间变量:
$upstream_response_time
:获取上游服务器的响应时间(需要在配置中开启upstream模块)。远程用户变量:
$remote_user
:获取HTTP基本认证中的用户名。请求和响应字节数变量:
$request_length
:获取请求的字节数。$bytes_sent
:获取发送到客户端的响应字节数。nginx.conf
The text was updated successfully, but these errors were encountered: