Fixes #3569 - Use port from foreman_url for templates