title: AWS Application Load Balancer - escape path pattern character
body: <p>I have deployed an AWS ALB Ingress Controller in EKS and k8s created an AWS ALB and created some rules to forward traffic:</p>
  
  <p>As documentation says:</p>
  
  <p><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#path-conditions" rel="nofollow noreferrer">https://docs.aws.amazon.com//elasticloadbalancing/latest/application/load-balancer-listeners.html</a> </p>
  
  <blockquote>
    <p><strong>Path Conditions</strong></p>
    
    <p>You can use path conditions to define rules that route requests based on the URL in the request (also known as path-based routing).
    The path pattern is applied only to the path of the URL, not to its query parameters.
    A path pattern is case-sensitive, can be up to 128 characters in length, and can contain any of the following characters.</p>
    
    <p>A–Z, a–z, 0–9</p>
    
    <p>_ - . $ / ~ " ' @ : +</p>
    
    <p>&amp; (using &amp;)</p>
    
    <p>*. (matches 0 or more characters)</p>
    
    <p>? (matches exactly 1 character)</p>
  </blockquote>
  
  <hr>
  
  <p>I have <em>two rules</em>:</p>
  
  <pre><code>1. IF Path is /api/* THEN Forward to XXX
  2. IF Path is /* THEN Forward to YYY
  </code></pre>
  
  <p><em>URLs</em> in my web app are:</p>
  
  <pre><code> 1. example.com/api/users/1 Forward to XXX [200 - OK]
   2. example.com/signin Forward to YYY [200 - OK]
   3. example.com/login-user returns 404 (the hyphen is recognized as a pattern)
  </code></pre>
  
  <p>Expected: Rule that forward request 3 to YYY</p>
  
  <p>I tried this:</p>
  
  <pre><code>IF Path is /* THEN Forward to YYY
  </code></pre>
  
  <p>No luck, in docs says nothing about, so how can I escape the hyphen to forward request 3 to YYY?</p>
  
  <p><strong>PD</strong>: I have around 50 uris with hyphens and I don't want rewrite them.</p>