通过nginx代理后
location / {
proxy_http_version 1.1;
proxy_pass https://api.mch.weixin.qq.com;
#proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host api.mch.weixin.qq.com;
proxy_set_header X-Forwarded-Proto $scheme;
#proxy_set_header X-Forwarded-proto https;
proxy_pass_request_headers on;
proxy_set_header $http_authorization $http_authorization;
proxy_set_header Aauthorization $http_authorization;
proxy_set_header Cookie $http_cookie;
proxy_buffering off;
proxy_read_timeout 3000;
proxy_send_timeout 3000;
}
请求接口报错{"code":"SIGN_ERROR","message":"Http头Authorization值格式错误,请参考《微信支付商户REST API签名规则》"},改成微信域名就正常了
1、有“Aauthorization”这个请求头?
2、proxy_set_header $http_authorization $http_authorization;这行$http_ 是用来提取请求头的前缀的啊,你不写头名称写俩提取是想做什么?
3、proxy_pass_request_headers:on ,你自己写Nginx 将所有原始请求头传递到后端,Authorization 头也应当包含在内的,看不懂你的写法