Refs #969 - Proxy-side changes for serving templates from the proxy

An update to @GregSutcliffe's original PR (https://github.com/theforeman/smart-proxy/pull/100/files). Ports his original feature to the new plugin api.
@witlessbird Addressable::URI doesn't seem as smart as URI when it comes to setting the right port.

> Addressable::URI.parse('https://google.com').port
=> nil

> URI.parse('https://www.google.com').port
=> 443