Page tree
Skip to end of metadata
Go to start of metadata

Address translation from local service addresses into public service addresses can be configured for each location configured for the Border Gateway (BGW) HTTP proxy.

Simple replacement

Assume your BGW HTTP proxy configuration looks like this with key translate_local_addresses existing:

"http_proxy_domains":{  
    "demo.linksmart.eu":{  
         "sc":{  
             "local_address":"http://sc:8082",
             "translate_local_addresses": true
         }
    }
}

This will make the BGW HTTP Proxy analyze each HTTP response and translate HTTP URLs like this:

  • Location known to BGW: http://sc:8082 → https://demo.linksmart.eu/sc
  • Location unknown to BGW: http://some_service:8081 → https://demo.linksmart.eu/aHR0cDovL3NvbWVfc2VydmljZTo4MDgx, where aHR0cDovL3NvbWVfc2VydmljZTo4MDgx is the Base64-encoded local service address. When the translated link is addressed, Border Gateway will forward the request to the local service. 
  • BGW will respect an existing x-forwarded-host HTTP header and use this for the translation.

Whitelisting

You can define an array of addresses for whitelisting (including wildcards), e.g.


"http_proxy_domains":{  
    "demo.linksmart.eu":{  
        "sc":{  
             "local_address":"http://sc:8082",
             "translate_local_addresses":{  
                 "whitelist":[  
                     "*.linksmart.eu",
                     "iot-linksmart-melon.iot:8080"
                 ]
             }
        }
    }
}

Addresses including host and port iot-linksmart-melon.iot:8080 as well as including any domain *.linksmart.eu will not be translated.

URL Translation map

For non-HTTP URLs you can define a translation map like this:

"http_proxy_domains":{  
    "demo.linksmart.eu":{  
        "sc":{  
             "local_address":"http://sc:8082",
             "translate_local_addresses":{  
                 "whitelist":[  
                     "*.linksmart.eu",
                     "iot-linksmart-melon.iot:8080"
                 ],
                 "url_translation_map": {
                     "tcp://mosquitto:1883": "ssl://demo.linksmart.eu:8883"
                 }
             }
        }
    }
}

This will obviously translate tcp://mosquitto:1883 into ssl://demo.linksmart.eu:8883. For URLs configured in the translation map whitelisting is ignored.

  • No labels