【问题标题】:URL redirect HAproxyURL 重定向 HAProxy
【发布时间】:2021-10-14 09:12:37
【问题描述】:

我需要将 ADFS 与 HAPROXY 一起使用。

目前我唯一的问题是我无法从https://adfsstg.xxx.com 重定向到https://adfsstg.xxx.com/adfs/ls/IdpInitiatedSignOn.aspx

这是我的前端:

frontend adfsstg
  bind 10.129.10.3:443 ssl crt /etc/ssl/certs/wildcard.pem
  mode http
  redirect scheme https if !{ ssl_fc }
  acl is_root path -i  /
  redirect code 301 location adfsstg.xxx.com/adfs/ls/IdpInitiatedSignOn.aspx  if is_root
  use_backend adfsstg

这是我的后端:

backend adfsstg
  balance roundrobin
  http-request set-header X-Forwarded-Port %[dst_port]
  http-request add-header X-Forwarded-Proto https if { ssl_fc }
  mode http
  http-request deny if !{ src -f /etc/haproxy/allowedoffices.acl }
  server adfsstg.xxx.com 10.129.9.144:443 check ssl verify none

你能帮帮我吗? 非常感谢

【问题讨论】:

    标签: redirect haproxy adfs


    【解决方案1】:

    我会用这个(未经测试)

    frontend adfsstg
      bind 10.129.10.3:80 
      bind 10.129.10.3:443 ssl crt /etc/ssl/certs/wildcard.pem
      mode http
      redirect scheme https if !{ ssl_fc }
    
      # path will mach also with the redirect URL 
      # because there is a '/' in the url
      # '-i' is useless because there is no uper or lower case for '/'
      # orig line "acl is_root path -i  /"
      acl is_root path_end /
      
      http-request redirect code 301 location https://adfsstg.xxx.com/adfs/ls/IdpInitiatedSignOn.aspx  if is_root
      use_backend adfsstg
    

    【讨论】:

      猜你喜欢
      • 2018-08-25
      • 2015-10-27
      • 2012-12-10
      • 2015-04-16
      • 2018-07-13
      • 2021-10-13
      • 2019-04-17
      • 2020-02-12
      • 1970-01-01
      相关资源
      最近更新 更多