Fixes #8267 - accept template_url in call to foreman from proxy

Also passes the ?static parameter on correctly.

@witlessbird @dustints could you comment and/or test? This will cut down on calls to /templateServer.

See also https://github.com/theforeman/smart-proxy/pull/232
Well spotted, updated and rebased just for fun too :)