【问题标题】:HAProxy redirect all traffic except for one url to httpsHAProxy 将除一个 url 之外的所有流量重定向到 https
【发布时间】:2014-07-29 09:40:37
【问题描述】:

我正在尝试将除一个文件之外的所有流量重定向到 https

我当前的配置:

  frontend public
     # HTTP
     bind :80

     redirect scheme https code 301 if !{ ssl_fc } !{ path_beg -i /dont-redirect-this.php }

它成功地重定向了所有流量,但也重定向了我不想要的/dont-redirect-this.php

任何想法我做错了什么?

【问题讨论】:

    标签: haproxy


    【解决方案1】:

    我刚刚解决了这个问题

    redirect scheme https code 301 if !{ url_reg \dont-redirect-this.php } !{ ssl_fc }
    

    【讨论】:

    • 保持清洁: 'acl check url_reg -i endpoint-check redirect scheme https code 301 if !{ ssl_fc } !check'
    猜你喜欢
    • 2016-05-09
    • 2017-10-23
    • 2014-03-30
    • 2016-09-16
    • 2014-05-02
    • 2014-08-23
    • 2013-01-06
    • 2014-04-27
    • 1970-01-01
    相关资源
    最近更新 更多