akamai / esi-test-server-docker

A dockerized version of Akamai's Edge Side Includes Test Server (ETS).
32 stars 6 forks source link

Pass request to remote without Host-Header #10

Open nikolaialex opened 5 years ago

nikolaialex commented 5 years ago

In order to use the ESI server you have to manually set the Host-Header for each request. This makes testing inside a browser cumbersome. Is there an option to pass all request - localhost - to the remote?

tdickers commented 5 years ago

You might find an /etc/hosts file entry helps somewhat. I not completely clear on what you're asking for - are you talking about having all requests to ETS to be passed to the origin with the Host header added? (Similar the Forward Host Header setting on the Akamai Origin Server behavior.)

nikolaialex commented 5 years ago

Thanks for your reply. I did not want to fiddle with my /etc/host. I want to test my application in the browser. I exspected, as you said, that all requests are forwarded to the origin server without setting any header in the http request. Uncoils use some browser extension or put nginx infront of ETS. But for testing I would rather avoid this.

Hope I have clarified my wish. Do you recommend another approach for testing web application behind ETS?

tdickers commented 5 years ago

Your wish has been clarified. I don't recommend a different approach for the current state of things besides setting Host headers or using an "artificial" CNAME via /etc/hosts or another mechanism for local DNS resolution[1].

Since we allow specifying multiple origins I think the fix would look something like adding a flag to specify the forward header for a given origin, or a shorter flag indicating some "auto" behavior there. I'll open an internal ticket for this; I think it's a good idea. I can't offer an ETA.

[1] - I can't vouch for this, but it's interesting: https://stackoverflow.com/questions/37242217/access-docker-container-from-host-using-containers-name/45071126#45071126