nginx 변수 값 보기

2605 단어
  • nginx 변수 값 보기
  • location / {
            echo $host; #  
            echo $remote_addr;
            echo $remote_user;
            echo $time_local;
            echo $request;
            echo $status;
            echo $body_bytes_sent;
            echo $http_referer;
            echo $http_user_agent;
            echo $http_x_forwarded_for;
    echo $proxy_add_x_forwarded_for; }
  • 설명
  • echo $host; #  
    echo $remote_addr; #   ip          ip
    echo $remote_user; #
    echo $time_local;  #  
    echo $request;     #    
    echo $status;      #  
    echo $body_bytes_sent;  #     
    echo $http_referer;   #referer
    echo $http_user_agent; #   
    echo $http_x_forwarded_for;  #      ,      ip
    echo $proxy_add_x_forwarded_for; # ip ip 。 ip
  •  nginx 내장 변수
  • nginx    
            Ngx_http_core_module        ,      apache         。
                     title   ,  $http_user_agent,$http_cookie  。
                       
            $proxy_add_x_forwarded_for   #  ip    ip     。   ip   
            $http_x_forwarded_for   #  ip
            $remote_addr   ip,     。       ip
            $document_root  # root     
            $args             
            $content_length      “Content_Length”  。
            $content_type        ”Content_Type”  
            $document_root        root      
            $document_uri $uri  
            $uri     request  URI,       ,           index
            $host      “Host”       request   server   (  Host )  ,          , ip     ip
            $limit_rate         
            $request_method   request method,   “GET” “POST”
            $remote_port   port
            $remote_user      , ngx_http_auth_basic_module  
            $request_filename           , root alias URI request    ,          
            $request_body_file
            $request_uri          URI
            $query_string $args  
            $sheeme http  (http,https)         
            Rewrite ^(.+)$ $sheme://example.com$; Redirect;
            $server_protocol   request   ,  “HTTP/ “HTTP/
            $server_addr request   server ip,                   。        ,    listen     ip,   bind  。    ip
            $server_name         ,  ,   ip        :_
            $server_port            

     
    다음으로 전송:https://www.cnblogs.com/hanxiaohui/p/8487934.html

    좋은 웹페이지 즐겨찾기