Layer7 API Management

 View Only
  • 1.  Handling request based on host name

    Posted May 18, 2021 11:34 AM
    Hi Team,

    I am looking for a solution in which whenever we any received by gateway it can check the hostname and route to some backend without caring about context path or uri

    example:

    https://<hostname1>/<uri>   -----> API gateway layer7 ----> some internal web Application <1>
    https://<hostname2>/<uri>   -----> API gateway layer7 ----> some internal web Application <2>

    We don't want to create multiple reverse proxies to handle overall traffic as the resolution paths may conflict.

    regards
    Suraj


  • 2.  RE: Handling request based on host name

    Posted May 19, 2021 09:02 AM
    • Context Variable : - incoming_request_url -> ${request.url.host}
    • At Least One must be true
      • Compare expression -> if ${incoming_request_url} = hostname1
        • Context Variable : - backend_url = hostname1
      • Compare expression -> if ${incoming_request_url} = hostname2
        • Context Variable : - backend_url = hostname1
      • Context Variable : - backend_url = default_host (if all fails)
    • Route Assertion 
      • URL : http/s://${backend_url}/${request.url.path}${request.url.query}
    This should work

    ------------------------------
    Pre-Sales Consultant
    CA Southern Africa
    ------------------------------