日志里看 HTTP/1.1 400 感觉.....
location /api {
proxy_pass
https://api.dingtalk.com;
proxy_http_version 1.1; # 新加的
proxy_connect_timeout 60;
proxy_read_timeout 60;
proxy_send_timeout 60;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host '
api.dingtalk.com';
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Connection ""; # 新加的
}
或者
location /api {
proxy_pass
https://api.dingtalk.com;
proxy_http_version 1.1; # 新加的
proxy_set_header Upgrade $http_upgrade; # 新加的
proxy_set_header Connection "upgrade"; # 新加的
proxy_connect_timeout 60;
proxy_read_timeout 60;
proxy_send_timeout 60;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host '
api.dingtalk.com';
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
感觉下面这个能行。