Rewriting request headers of a request to origin server in Traffic Server?

27 Views Asked by At

I would like to setup an proxy server to simplify a request and cache results for a specific server. However, The Traffic Server does not have this kind of features as I know.

The diagram below is an sketch of the structure.

       |---------------|
       | Origin Server | ----------------
       |---------------|                |
               ^                    <Response>
               |                        |
  < Complex Request w/ some headers >   |
               |                        |
       |----------------| <--------------                          |------------|
       | Traffic Server | <--- Request Translation w/ Redirect --->| Translator |
       |----------------| ---------------                          |------------|
               ^                        |
               |                   < Response >
   < Simple Request w/o headers>        |
               |                        |
       |----------------|               |
       |     Client     |<---------------
       |----------------|

Could you tell me whether there is any plugin or features enabling this kind of structure?

I tried adding headers in a request from a Client to Traffic Server. However, there is no headers in a request from a Traffic Server to Origin Server.

1

There are 1 best solutions below

0
Miles Libbey On

The Header Rewrite plugin allows you to add, remove and modify headers. In the hook diagram, the SEND_REQUEST_HDR_HOOK would be the spot to change headers to the origin server. I'd guess that you'd map the inbound domain to your translator service, use the conf remap plugin to set proxy.config.http.number_of_redirections to chase the redirect, then use header_rewrite to modify the headers when going to the real origin.