title: Converting Nginx config to Haproxy
body: <p>I am trying to migrate my reverseproxy from Nginx to Haproxy to use it's health checks, maps and monitoring capabilities.</p>
  
  <p>HAProxy config seems not as straight forward as Nginx. Can someone help me convert below nginx rules to haproxy config.</p>
  
  <pre><code>  location = / {
      proxy_set_header X-Forwarded-Host $server_name;
      proxy_pass https://myapp.azurewebsites.net;
    }
    location /test {
      proxy_pass https://myapp.azurewebsites.net;
    }
    location /test/ {
      proxy_pass https://myapp.azurewebsites.net;
    }
  </code></pre>
  
  <p>So i have same backend for all the rules. I am using below HAProxy config but it's working only for <code>/test/</code> but not for <code>/test</code></p>
  
  <pre><code>acl is_domain hdr(host) -i www.domain.com
  use_backend be_test if is_domain { path -i / } || { path -i -m beg /test} 
  
  backend be_test
  mode http
  option forwardfor
  http-request set-header X-Forwarded-Port %[dst_port]
  http-request add-header X-Forwarded-Proto https if { ssl_fc }
  http-request replace-header Host .* myapp.azurewebsites.net
  server srv01 myapp.azurewebsites.net:443 weight 1 maxconn 100  check ssl verify none
  </code></pre>