gpt4 book ai didi

nginx - 用于https的 Varnish

转载 作者:行者123 更新时间:2023-12-03 17:45:21 24 4
gpt4 key购买 nike

这是情况。我的客户端通过安全网络 (https) 与多个后端通信。现在,我想为主要负载平衡(基于头数据或 cookie)和一些缓存建立一个反向代理。所以,我认为 Varnish 可能有用。

但是,varnish 不支持 ssl 连接。正如我在很多地方读到的那样,引用 "Varnish does not support SSL termination natively" 。但是,我想要每个连接,即。客户端 Varnish 和 Varnish 后端通过 https。我不能在整个网络的任何地方拥有纯文本数据(有限制),所以没有其他东西可以用作 SSL 终止符(或者可以?)。

所以,这里是问题:

  • 首先,“Varnish 本身不支持 SSL 终止”是什么意思(如果有人可以用简单的术语解释)。
  • 其次,这个场景是否适合使用 Varnish 实现?
  • 最后,如果 varnish 不是一个好的竞争者,我是否应该切换到其他一些反向代理。如果是,那么哪个适合该场景? (HA、Nginx 等)
  • 最佳答案

    what does this mean (if someone can explain in simple terms) that "Varnish does not support SSL termination natively"



    这意味着Varnish没有对SSL的内置支持。除非SSL由单独的软件处理,否则它无法在使用SSL的路径中运行。

    这是Varnish作者的一项架构决定,他在2011年讨论了将SSL集成到Varnish中的构想。

    他基于许多因素,其中最重要的一点就是想要做到这一点,同时观察到SSL的事实上的标准库是openssl,这是一个迷宫式的集合,包含300,000行以上的代码,并且他既不对该代码库充满信心,也不对成本/ yield 比有利的可能性充满信心。

    总之,他当时的结论是“不”。

    That is not one of the things I dreamt about doing as a kid and if I dream about it now I call it a nightmare.

    https://www.varnish-cache.org/docs/trunk/phk/ssl.html



    他在2015年重新审视了这个概念。

    他的结论再次是“不”。

    Code is hard, crypto code is double-plus-hard, if not double-squared-hard, and the world really don't need another piece of code that does an half-assed job at cryptography.

    ...

    When I look at something like Willy Tarreau's HAProxy I have a hard time to see any significant opportunity for improvement.

    No, Varnish still won't add SSL/TLS support.

    Instead in Varnish 4.1 we have added support for Willys PROXY protocol which makes it possible to communicate the extra details from a SSL-terminating proxy, such as HAProxy, to Varnish.

    https://www.varnish-cache.org/docs/trunk/phk/ssl_again.html



    此增强功能可以简化将 Varnish 集成到具有加密要求的环境中的过程,因为它提供了另一种机制,可以在卸载的SSL设置中保留原始浏览器的身份。

    is this scenario good to implement using varnish?



    如果需要使用Varnish,请注意必须单独处理SSL。但是请注意,这并不一定意味着未加密的流量必须经过您的网络...尽管这样做确实会使设置更加复杂且占用大量CPU资源。

    nothing else can be used as SSL-Terminator (or can be?)



    可以在Varnish的正面卸载SSL,然后在Varnish的背面重新建立SSL,所有这些都可以在运行Varnish的同一台计算机上进行,但是可以通过单独的过程,使用HAProxy或stunnel或nginx或其他解决方案,在在 Varnish 后面。毫无疑问,任何流量都在一个主机的范围内进行,因此,如果主机本身是安全的,则可以说这不是漏洞点,因为它永远不会离开计算机。

    if varnish is not a good contender, should I switch to some other reverse proxy



    这完全取决于您在堆栈中想要和想要的东西,它对您的成本/ yield ,您的专业水平,资源的可用性以及其他因素。每个选项都有其自己的功能和局限性,并且在同一堆栈中使用多个选项肯定不是闻所未闻的。

    关于nginx - 用于https的 Varnish ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33475154/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com