Allow to specify the endpoint type to use

Not everybody will want to use publicURL, so let's make this configurable.

Change-Id: Ice85a8ef1083580d89285e83239de872939665af
Fixes: bug#1188469
(cherry picked from commit e541fcb0d47e0beb447fb1a3ce1d62881fa382f8)
Merge "Allow to specify the endpoint type to use" into stable/grizzly