(资料图)
通过编译安装的时候指定echo模块,实现打印输出变量的值。
# 客户端地址:10.0.0.66root@ubuntu1804:~# curl 10.0.0.44/x/y/z?name=bob?passwd=123remote_addr: 10.0.0.66 #客户端ip地址args: name=bob?passwd=123 #存放了URL中的所有参数document_root: /data/html #当前资源的请求的系统根目录document_uri: /x/y/z #当前请求中不包含参数的URIhost: 10.0.0.44 #请求的host名称,可以是ip地址,也可以是域名http_user_agent: curl/7.58.0 #客户端浏览器的详细信息http_cookie: #客户端的所有cookie信息request_filename: /data/html/x/y/z #当前请求的资源文件的磁盘路径scheme: http #请求的协议,例如:http,https,ftp等scheme://host+document_uri+args: http://10.0.0.44/x/y/z?name=bob?passwd=123request: GET /x/y/z?name=bob?passwd=123 HTTP/1.1 #表示整个请求行proxy_add_x_forwarded_for: 10.0.0.66 #示将客户端IP追加请求报文中X-Forwarded-For首部字段,多个IP之间用逗号分隔 # 用来实现IP透传(后端服务器能看到客户端ip和代理服务器的ip) args: name=bob?passwd=123 #变量中存放了URL中的所有参数request_uri: /x/y/z?name=bob?passwd=123 #请求参数的原始URI,不包含主机名request_method: GET #请求资源的方式,GET/PUT/DELETE等server_addr: 10.0.0.44 #保存了服务器的IP地址server_name: localhost ##请求的服务器的主机名 server_port: 80 #请求的服务器的端口号# 表示一个完整的请求路径:方法一:$scheme://$host:$document_uri?$args# 例如:curl http://10.0.0.44/x/y/z?name=bob?passwd=123 http://10.0.0.44/x/y/z?name=bob?passwd=123 方法二:$scheme://$server_addr:$server_port$document_uri?$args;root@ubuntu1804:~# curl 10.0.0.44:8080/x/y/z?name=bob?passwd=123# http://10.0.0.44:8080/x/y/z?name=bob?passwd=123