You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Jeremy Payne <jp...@gmail.com> on 2015/11/11 19:12:02 UTC

proxy.config.http.redirection_enabled and override

I see that master(6.1.0) now 'supports' redirection override.

./trafficserver/proxy/http/HttpConfig.cc:
HttpEstablishStaticConfigByte(c.oride.redirection_enabled,
"proxy.config.http.redirection_enabled");
./trafficserver/proxy/http/HttpConfig.cc:
params->oride.redirection_enabled =
INT_TO_BOOL(m_master.oride.redirection_enabled);


In testing I see that the redirection value is changed per the over-ride
config(witnessed via debug output), yet I dont see the override value is
applied to the session/transaction.

Is the override code fully implemented? As it seems only the override code
is there but maybe the transaction code hasnt been updated to account for
the redirection override.


Thanks!

Re: proxy.config.http.redirection_enabled and override

Posted by Leif Hedstrom <zw...@apache.org>.
> On Nov 11, 2015, at 2:29 PM, Jeremy Payne <jp...@gmail.com> wrote:
> 
> My goal is leave the option turned off via records.config. However based on certain conditions within the request, I would like to turn it on.. So I am doing this within a lua script. I see that the master(6.1.0) lua plugin supports redirection override, but it appears(per your response) as of this writing it must be done from a global scope instead of a per remap basis. 
> I also tried using the config remap plugin per remap , and no luck there either.


Hmmm, if you are writing your own plugin, there are APIs to work / deal with redirections directly. E.g.

	TSHttpTxnRedirectUrlSet()
	TSHttpTxnRedirectRetries()


— Leif

>  
> Is there a reason for only allowing this override so far up the transaction chain? It would seem more operator friendly if the override could be applied at least after entering the remap stage.. Unless this override is meant solely for forward proxy environments. I am currently running ATS in reverse proxy mode and relying heavily on per remap lua scripts to modify the request accordingly.
> 
> Thanks!
>  
> 
> On Wed, Nov 11, 2015 at 2:26 PM, Sudheer Vinukonda <sudheerv@yahoo-inc.com <ma...@yahoo-inc.com>> wrote:
> Which hook are you using to override?
> 
> The config is applied before READ_REQUEST_HDR hook, so, you will need to override it in TXN_START hook.
> 
> Thanks,
> 
> Sudheer
> 
> 
> 
> On Wednesday, November 11, 2015 10:12 AM, Jeremy Payne <jp557198@gmail.com <ma...@gmail.com>> wrote:
> 
> 
> 
> 
> I see that master(6.1.0) now 'supports' redirection override.
> 
> ./trafficserver/proxy/http/HttpConfig.cc:  HttpEstablishStaticConfigByte(c.oride.redirection_enabled, "proxy.config.http.redirection_enabled");
> ./trafficserver/proxy/http/HttpConfig.cc:  params->oride.redirection_enabled = INT_TO_BOOL(m_master.oride.redirection_enabled);
> 
> 
> In testing I see that the redirection value is changed per the over-ride config(witnessed via debug output), yet I dont see the override value is applied to the session/transaction.
> 
> Is the override code fully implemented? As it seems only the override code is there but maybe the transaction code hasnt been updated to account for the redirection override.
> 
> 
> Thanks!
>  
> 
> 
> 
> 
> 


Re: proxy.config.http.redirection_enabled and override

Posted by Sudheer Vinukonda <su...@yahoo-inc.com>.
Can't think of any specific reason other than the fact that, there are other ways of achieving what you are asking already:


e.g. TSHttpTxnFollowRedirect(), TSHttpTxnRedirectUrlSet()

If you really need to use Lua to modify the config, please open a jira to read/apply the setting at a later hook.

Thanks,

Sudheer





On Wednesday, November 11, 2015 1:29 PM, Jeremy Payne <jp...@gmail.com> wrote:



My goal is leave the option turned off via records.config. However based on certain conditions within the request, I would like to turn it on.. So I am doing this within a lua script. I see that the master(6.1.0) lua plugin supports redirection override, but it appears(per your response) as of this writing it must be done from a global scope instead of a per remap basis. 

I also tried using the config remap plugin per remap , and no luck there either.
 

Is there a reason for only allowing this override so far up the transaction chain? It would seem more operator friendly if the override could be applied at least after entering the remap stage.. Unless this override is meant solely for forward proxy environments. I am currently running ATS in reverse proxy mode and relying heavily on per remap lua scripts to modify the request accordingly.


Thanks!
 



On Wed, Nov 11, 2015 at 2:26 PM, Sudheer Vinukonda <su...@yahoo-inc.com> wrote:

Which hook are you using to override?
>
>
>The config is applied before READ_REQUEST_HDR hook, so, you will need to override it in TXN_START hook.
>
>
>Thanks,
>
>
>Sudheer
>
>
>
>
>
>On Wednesday, November 11, 2015 10:12 AM, Jeremy Payne <jp...@gmail.com> wrote:
> 
>
>
>
>
>I see that master(6.1.0) now 'supports' redirection override.
>
>./trafficserver/proxy/http/HttpConfig.cc:  HttpEstablishStaticConfigByte(c.oride.redirection_enabled, "proxy.config.http.redirection_enabled");
>./trafficserver/proxy/http/HttpConfig.cc:  params->oride.redirection_enabled = INT_TO_BOOL(m_master.oride.redirection_enabled);
>
>
>In testing I see that the redirection value is changed per the over-ride config(witnessed via debug output), yet I dont see the override value is applied to the session/transaction.
>
>
>Is the override code fully implemented? As it seems only the override code is there but maybe the transaction code hasnt been updated to account for the redirection override.
>
>
>Thanks!
>
> 
>
>
>
>
>

Re: proxy.config.http.redirection_enabled and override

Posted by Jeremy Payne <jp...@gmail.com>.
My goal is leave the option turned off via records.config. However based on
certain conditions within the request, I would like to turn it on.. So I am
doing this within a lua script. I see that the master(6.1.0) lua plugin
supports redirection override, but it appears(per your response) as of this
writing it must be done from a global scope instead of a per remap basis.
I also tried using the config remap plugin per remap , and no luck there
either.

Is there a reason for only allowing this override so far up the transaction
chain? It would seem more operator friendly if the override could be
applied at least after entering the remap stage.. Unless this override is
meant solely for forward proxy environments. I am currently running ATS in
reverse proxy mode and relying heavily on per remap lua scripts to modify
the request accordingly.

Thanks!


On Wed, Nov 11, 2015 at 2:26 PM, Sudheer Vinukonda <su...@yahoo-inc.com>
wrote:

> Which hook are you using to override?
>
> The config is applied before READ_REQUEST_HDR hook, so, you will need to
> override it in TXN_START hook.
>
> Thanks,
>
> Sudheer
>
>
>
> On Wednesday, November 11, 2015 10:12 AM, Jeremy Payne <jp...@gmail.com>
> wrote:
>
>
>
>
> I see that master(6.1.0) now 'supports' redirection override.
>
> ./trafficserver/proxy/http/HttpConfig.cc:
> HttpEstablishStaticConfigByte(c.oride.redirection_enabled,
> "proxy.config.http.redirection_enabled");
> ./trafficserver/proxy/http/HttpConfig.cc:
> params->oride.redirection_enabled =
> INT_TO_BOOL(m_master.oride.redirection_enabled);
>
>
> In testing I see that the redirection value is changed per the over-ride
> config(witnessed via debug output), yet I dont see the override value is
> applied to the session/transaction.
>
> Is the override code fully implemented? As it seems only the override code
> is there but maybe the transaction code hasnt been updated to account for
> the redirection override.
>
>
> Thanks!
>
>
>
>
>
>

Re: proxy.config.http.redirection_enabled and override

Posted by Jeremy Payne <jp...@gmail.com>.
Jira opened for this work.

https://issues.apache.org/jira/browse/TS-4017

"Objective here is to allow proxy.config.http.redirection_enabled override
to be set in all transaction hooks up to and including 'READ_RESPONSE_HDR'"



On Wed, Nov 11, 2015 at 5:49 PM, Jeremy Payne <jp...@gmail.com> wrote:

> Thanks James that would be ideal at least in my case.
>
> As a fyi, and for historical purposes I was able to override redirect
> within TXN_START. However, doesn't seem like I have access to request
> information to make certain decisions. I will run this again with debug
> enabled to see whats available during this hook point.
>
> -- START LUA SCRIPT
> function do_global_txn_start()
>    ts.http.config_int_set(TS_LUA_CONFIG_HTTP_ENABLE_REDIRECTION, 1)
>    return 0
> end
> -- END LUA SCRIPT
>
>
> On Wed, Nov 11, 2015 at 4:56 PM, James Peach <jp...@apache.org> wrote:
>
>>
>> > On Nov 11, 2015, at 12:26 PM, Sudheer Vinukonda <su...@yahoo-inc.com>
>> wrote:
>> >
>> > Which hook are you using to override?
>> >
>> > The config is applied before READ_REQUEST_HDR hook, so, you will need
>> to override it in TXN_START hook.
>>
>> That seems unfortunate. Can we move that back to READ_RESPONSE_HDR?
>>
>> >
>> > Thanks,
>> >
>> > Sudheer
>> >
>> >
>> >
>> > On Wednesday, November 11, 2015 10:12 AM, Jeremy Payne <
>> jp557198@gmail.com> wrote:
>> >
>> >
>> >
>> >
>> > I see that master(6.1.0) now 'supports' redirection override.
>> >
>> > ./trafficserver/proxy/http/HttpConfig.cc:
>> HttpEstablishStaticConfigByte(c.oride.redirection_enabled,
>> "proxy.config.http.redirection_enabled");
>> > ./trafficserver/proxy/http/HttpConfig.cc:
>> params->oride.redirection_enabled =
>> INT_TO_BOOL(m_master.oride.redirection_enabled);
>> >
>> >
>> > In testing I see that the redirection value is changed per the
>> over-ride config(witnessed via debug output), yet I dont see the override
>> value is applied to the session/transaction.
>> >
>> > Is the override code fully implemented? As it seems only the override
>> code is there but maybe the transaction code hasnt been updated to account
>> for the redirection override.
>> >
>> >
>> > Thanks!
>> >
>> >
>> >
>> >
>> >
>>
>>
>

Re: proxy.config.http.redirection_enabled and override

Posted by Jeremy Payne <jp...@gmail.com>.
Thanks James that would be ideal at least in my case.

As a fyi, and for historical purposes I was able to override redirect
within TXN_START. However, doesn't seem like I have access to request
information to make certain decisions. I will run this again with debug
enabled to see whats available during this hook point.

-- START LUA SCRIPT
function do_global_txn_start()
   ts.http.config_int_set(TS_LUA_CONFIG_HTTP_ENABLE_REDIRECTION, 1)
   return 0
end
-- END LUA SCRIPT


On Wed, Nov 11, 2015 at 4:56 PM, James Peach <jp...@apache.org> wrote:

>
> > On Nov 11, 2015, at 12:26 PM, Sudheer Vinukonda <su...@yahoo-inc.com>
> wrote:
> >
> > Which hook are you using to override?
> >
> > The config is applied before READ_REQUEST_HDR hook, so, you will need to
> override it in TXN_START hook.
>
> That seems unfortunate. Can we move that back to READ_RESPONSE_HDR?
>
> >
> > Thanks,
> >
> > Sudheer
> >
> >
> >
> > On Wednesday, November 11, 2015 10:12 AM, Jeremy Payne <
> jp557198@gmail.com> wrote:
> >
> >
> >
> >
> > I see that master(6.1.0) now 'supports' redirection override.
> >
> > ./trafficserver/proxy/http/HttpConfig.cc:
> HttpEstablishStaticConfigByte(c.oride.redirection_enabled,
> "proxy.config.http.redirection_enabled");
> > ./trafficserver/proxy/http/HttpConfig.cc:
> params->oride.redirection_enabled =
> INT_TO_BOOL(m_master.oride.redirection_enabled);
> >
> >
> > In testing I see that the redirection value is changed per the over-ride
> config(witnessed via debug output), yet I dont see the override value is
> applied to the session/transaction.
> >
> > Is the override code fully implemented? As it seems only the override
> code is there but maybe the transaction code hasnt been updated to account
> for the redirection override.
> >
> >
> > Thanks!
> >
> >
> >
> >
> >
>
>

Re: proxy.config.http.redirection_enabled and override

Posted by James Peach <jp...@apache.org>.
> On Nov 11, 2015, at 12:26 PM, Sudheer Vinukonda <su...@yahoo-inc.com> wrote:
> 
> Which hook are you using to override?
> 
> The config is applied before READ_REQUEST_HDR hook, so, you will need to override it in TXN_START hook.

That seems unfortunate. Can we move that back to READ_RESPONSE_HDR?

> 
> Thanks,
> 
> Sudheer
> 
> 
> 
> On Wednesday, November 11, 2015 10:12 AM, Jeremy Payne <jp...@gmail.com> wrote:
> 
> 
> 
> 
> I see that master(6.1.0) now 'supports' redirection override.
> 
> ./trafficserver/proxy/http/HttpConfig.cc:  HttpEstablishStaticConfigByte(c.oride.redirection_enabled, "proxy.config.http.redirection_enabled");
> ./trafficserver/proxy/http/HttpConfig.cc:  params->oride.redirection_enabled = INT_TO_BOOL(m_master.oride.redirection_enabled);
> 
> 
> In testing I see that the redirection value is changed per the over-ride config(witnessed via debug output), yet I dont see the override value is applied to the session/transaction.
> 
> Is the override code fully implemented? As it seems only the override code is there but maybe the transaction code hasnt been updated to account for the redirection override.
> 
> 
> Thanks!
>  
> 
> 
> 
> 


Re: proxy.config.http.redirection_enabled and override

Posted by Sudheer Vinukonda <su...@yahoo-inc.com>.
Which hook are you using to override?
The config is applied before READ_REQUEST_HDR hook, so, you will need to override it in TXN_START hook.
Thanks,
Sudheer 


     On Wednesday, November 11, 2015 10:12 AM, Jeremy Payne <jp...@gmail.com> wrote:
   

 

I see that master(6.1.0) now 'supports' redirection override.

./trafficserver/proxy/http/HttpConfig.cc:  HttpEstablishStaticConfigByte(c.oride.redirection_enabled, "proxy.config.http.redirection_enabled");
./trafficserver/proxy/http/HttpConfig.cc:  params->oride.redirection_enabled = INT_TO_BOOL(m_master.oride.redirection_enabled);


In testing I see that the redirection value is changed per the over-ride config(witnessed via debug output), yet I dont see the override value is applied to the session/transaction.

Is the override code fully implemented? As it seems only the override code is there but maybe the transaction code hasnt been updated to account for the redirection override.


Thanks!