Welcome! Log In Create A New Profile

Advanced

Re: Rewriting the domain part of Set-Cookie in a proxy_pass

杨镭
June 08, 2011 03:32PM
I am curious when there is an output_by_lua/output_by_luafle directive in
nginx-lua module. Currently, if one want to set/modify response header, the
only possible way is to do a subrequest using ngx.capture.

I think this is really cumbersome compared to declarative configuration such
as: output_by_lua_file.

cc'ed agentzh

On Wed, Jun 8, 2011 at 10:17 PM, Justin Cormack <
justin@specialbusservice.com> wrote:

> On Wed, Jun 8, 2011 at 3:02 PM, tobia <nginx-forum@nginx.us> wrote:
>
>> António P. P. Almeida Wrote:
>> > > How can I rewrite the content of the Set-Cookie
>> > > response headers, replacing ";Domain=backend.int"
>> > > with ";Domain=external.domain.com"?
>> >
>> > AFAIK you'll need to use 3rd party modules. Either
>> > http://wiki.nginx.org/HttpHeadersMoreModule and/or
>> > http://github.com/chaoslawful/lua-nginx-module
>> >
>> > Probably the Embedded Perl module let's you do
>> > that also. You'll have to try it out.
>>
>> Thanks for the pointers.
>>
>> HttpHeadersMoreModule doesn't seem to let me replace parts of headers.
>>
>> Lua doesn't seem to have it either:
>> > Reading values from ngx.header.HEADER is not
>> > implemented yet, and usually you shouldn't need it.
>>
>> I think you need to read the headers you get back from
> ngx.location.capture in Lua (retrieve the backend response), then set the
> outbound headers with ngx.HEADER, so you should be able to do this in Lua..
>
> So your content_by_lua block calls ngx.location.capture to get the backend
> response, reads the headers it gets from there, then sets the outbound
> headers....
>
> Justin
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>


--
lei yang
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rewriting the domain part of Set-Cookie in a proxy_pass

tobia June 08, 2011 09:16AM

Re: Rewriting the domain part of Set-Cookie in a proxy_pass

António P. P. Almeida June 08, 2011 09:36AM

Re: Rewriting the domain part of Set-Cookie in a proxy_pass

tobia June 08, 2011 10:02AM

Re: Rewriting the domain part of Set-Cookie in a proxy_pass

tobia June 08, 2011 10:06AM

Re: Rewriting the domain part of Set-Cookie in a proxy_pass

Justin Cormack June 08, 2011 10:18AM

Re: Rewriting the domain part of Set-Cookie in a proxy_pass

杨镭 June 08, 2011 03:32PM

Re: Rewriting the domain part of Set-Cookie in a proxy_pass

agentzh June 08, 2011 10:10PM

Re: Rewriting the domain part of Set-Cookie in a proxy_pass

tobia June 27, 2011 04:50AM

Re: Rewriting the domain part of Set-Cookie in a proxy_pass

Maxim Dounin June 08, 2011 10:20AM

Re: Rewriting the domain part of Set-Cookie in a proxy_pass

agentzh September 14, 2011 04:50AM

Re: Rewriting the domain part of Set-Cookie in a proxy_pass

agentzh September 14, 2011 05:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 220
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready