使用多个proxy_ssl_certificate使nginx proxy_pass到上游服务器

我有一个用例,其中上游服务器将信任不同的CA。这主要是在过渡期间发生的,因此我想通过尝试两个不同的CA证书将我的nginx代理连接到上游服务器。

目前,我有一个类似的想法:

location /upstream1 {
  proxy_pass                      https://$http_host$uri;
  proxy_ssl_certificate           /home/keys/cert.pem
  proxy_ssl_certificate_key       /home/keys/key.pem
  proxy_ssl_trusted_certificate   /home/keys/trust.pem
  proxy_intercept_errors on;
  recursive_error_pages on;
  error_page 495 496 = @use_cert2
}

location @use_cert2 {
  proxy_pass                      https://$http_host$uri;
  proxy_ssl_certificate           /home/keys/cert2.pem
  proxy_ssl_certificate_key       /home/keys/key2.pem
  proxy_ssl_trusted_certificate   /home/keys/trust2.pem
}

这是拥有“尝试使用此证书代理上游服务器的逻辑。如果服务器不喜欢它,则使用此其他证书”的逻辑是最优雅的方法。

它还会调用@ use_cert2,它是否保留上一个调用块中发生的任何重写?

如果问题没有足够的信息,请提前道歉。

感谢您阅读这篇文章!

chendodo2009 回答:使用多个proxy_ssl_certificate使nginx proxy_pass到上游服务器

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3107722.html

大家都在问