nginx内置变量#

获取内置变量#

 location /var {
        default_type text/plain;

        # binary_remote_addr:$binary_remote_addr
        return 200
        '
        host:$host
        hostname:$hostname
        uri:$uri
        arg_name:$arg_name
        args:$args
        body_bytes_sent:$body_bytes_sent
        bytes_sent:$bytes_sent
        connection:$connection
        connection_requests:$connection_requests
        connection_time:$connection_time
        content_length:$content_length
        content_type:$content_type
        cookie_name:$cookie_name
        document_root:$document_root
        document_uri:$document_uri
        http_name:$http_name
        https:$https
        is_args:$is_args
        limit_rate:$limit_rate
        msec:$msec
        nginx_version:$nginx_version
        pid:$pid
        pipe:$pipe
        proxy_protocol_addr:$proxy_protocol_addr
        proxy_protocol_port:$proxy_protocol_port
        proxy_protocol_server_addr:$proxy_protocol_server_addr
        proxy_protocol_server_port:$proxy_protocol_server_port
        query_string:$query_string
        realpath_root:$realpath_root
        remote_addr:$remote_addr
        remote_port:$remote_port
        remote_user:$remote_user
        request:$request
        request_body:$request_body
        request_body_file:$request_body_file
        request_completion:$request_completion
        request_filename:$request_filename
        request_id:$request_id
        request_length:$request_length
        request_method:$request_method
        request_time:$request_time
        request_uri:$request_uri
        scheme:$scheme
        sent_http_name:$sent_http_name
        sent_trailer_name:$sent_trailer_name
        server_addr:$server_addr
        server_name:$server_name
        server_port:$server_port
        server_protocol:$server_protocol
        status:$status
        tcpinfo_rtt:$tcpinfo_rtt
        tcpinfo_rttvar:$tcpinfo_rttvar
        tcpinfo_snd_cwnd:$tcpinfo_snd_cwnd
        tcpinfo_rcv_space:$tcpinfo_rcv_space
        time_iso8601:$time_iso8601
        time_local:$time_local
        ';
    }