Fixes #3569 - Use port form foreman_url for templates