akamai/esi-test-server-docker

Add alternative header for HOST like X-HOST

Opened this issue · 0 comments

Hi,
I'm talking about To get a processed ESI page from yoursite.example.com, add "Host: yoursite.example.com" header.

I'm running IIS as a primary server (running on port 80) and make it work as a reverse proxy server for ETS. I set it up so if you request a site like ets.local.iis.site.com, IIS will forward request to ETS (reverse proxy request to localhost:8080), then ETS will send request to local.iis.site.com which also runs on IIS.

I already managed to update hosts config to point local.iis.site.com to host machine, so there will be no problems with connection between ETS and local.iis.site.com running on host machine through IIS.

My problem is that I need to force Host: local.iis.site.com header to be passed through IIS to ETS as part of reverse proxy request and that is where I'm facing a challenge.
Standard way to use IIS as a reverse proxy involves ARR (Application Request Routing) module. The only way to do that is to add preserveHostHeader="true" attribute to <proxy /> element in applicationHost.config file. Problem is that this configuration is for server level, not for site level, which can cause issues with other sites that should be behind reverse proxy in future.

That is why I wonder if it is possible for ETS to also check for x-host header value and use that one over host header if it exists - that way it will be easier to configure ETS behind IIS ARR module.
I feel that that will require a couple of line change on your end which will save a lot of time for me and anyone else in my situation (there are 50-100 devs that will have to manually adjust applicationHost.config @ my organization). Would it be possible for you to implement this please?

Also if you can point me in a direction where host detection is happening inside ETS container I would be able to adjust that logic myself until you have time to publish a fix - please let me know if that is possible.

If there are any questions, I would be happy to answer them.
Thank you.