Did you try to use the base_url configuration option  to achieve
this? Setting this to '/' could achieve the behavior you are looking
If this doesn't work, you could have some code in your request cycle
that modifies the NeededResources instance for that request based on
certain request variables (HTTPS yes/no) that you could pass in from
the configuration of an intermediate server. I don't know enough about
your stack to say something useful in that area.