Nginx http反向代理流程Proxy_pass模块

时间:2023-03-08 17:53:12

88-90

Nginx http反向代理流程Proxy_pass模块

Nginx http反向代理流程Proxy_pass模块

Nginx http反向代理流程Proxy_pass模块

Nginx http反向代理流程Proxy_pass模块

Nginx http反向代理流程Proxy_pass模块

Nginx http反向代理流程Proxy_pass模块

反向代理代码示列

 server {
listen ;
server_name shop**.com.cn; location /{
proxy_pass http://test/www;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_method POST;
proxy_pass_request_headers off;
proxy_pass_request_body off;
proxy_set_body 'hello world'; #传入包体 通过抓包查看
proxy_set_header name ''; #将自定义头部 name 置空
}
upstream test {
server 192.168..**: weight= ;
#keepalive ;
least_conn ;
zone backends 64k;
} }

上游服务器代码示列

server {
listen ;
return "8890 server respnese.
uri.$uri
method:$request_method
request:$request
http_name:$http_name
\n";
}
tcpdump -i lo port  -A -s  //抓包查看body内容

Nginx http反向代理流程Proxy_pass模块