nginx做正向代理https遇到502错误返回,查看nginx的错误日志发现有大量的此类错误,
SSL_do_handshake() failed (SSL: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number) while SSL handshaking to upstream, client:......
根据反馈是短时间内连续性请求则会返回502错误,查询资料发现nginx默认会尝试重新使用SSL上游的SSL会话。
解决方式是配置文件增加:
proxy_ssl_session_reuse off;
location / { ... ... proxy_ssl_session_reuse off; ... ... }