Skip to content

nginx反向代理-get参数丢失问题

特定的接口进行反向代理,出现了get请求参数丢失的情况,处理如下:

location /mxx/login {
	proxy_pass $scheme://172.16.1.196:80/a/b/c/cloudLogin?$args;	
	proxy_set_header Host gw-dev.msunhis.com;	
	proxy_set_header X-Real-IP $remote_addr;	
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header Upgrade $http_upgrade;
	client_max_body_size 8M;
}
location /mxx/login {
	proxy_pass $scheme://172.16.1.196:80/a/b/c/cloudLogin?$args;	
	proxy_set_header Host gw-dev.msunhis.com;	
	proxy_set_header X-Real-IP $remote_addr;	
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header Upgrade $http_upgrade;
	client_max_body_size 8M;
}

参考 nginx-get请求参数丢失 - 掘金