Welcome! Log In Create A New Profile

Advanced

Re: Can I modify headers_out's "location" in body filter?

Weibin Yao
June 17, 2010 04:58AM
ckong at 2010-6-17 16:27 wrote:
> Hi all,
> I'm a newbie in nginx module development. I've a question here, need
> your help.
> I'm trying to develop a filter, which works with memcached, is used for
> request routing.
> for example, the conf here:
> [code]
> location /test {
> my_rr on;
> set $memcached_key $arg_key;
> memcached_pass 127.0.0.1:11211;
> default_type text/html;
> }
> [/code]
>
> ps: my_rr enables my filter.
> In my filter module, I've modify headers_out.status = 302 in my header
> filter, and I want to modify "Location" in my body filter, because the
> value of "Location" depends on the response of memcached.
>
> I do modify headers_out.location in my body filter, but it doesn's work.
>
No,your modification is useless. Nginx sends the headers first, even
before receiving all the response body from backends.
>
> Could anybody tell me if I miss something?
>
> Great thanks!
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,99290,99290#msg-99290
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>


--
Weibin Yao


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

Can I modify headers_out's "location" in body filter?

ckong June 17, 2010 04:27AM

Re: Can I modify headers_out's "location" in body filter?

Weibin Yao June 17, 2010 04:58AM

Re: Can I modify headers_out's "location" in body filter?

ckong June 17, 2010 05:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 148
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready