retrieve server url and port from location variable