Welcome! Log In Create A New Profile

Advanced

[SOLVED] Re: subrequest headers ignored

Konstantin Svist
November 22, 2011 05:18PM
https://github.com/chaoslawful/lua-nginx-module/issues/6


On 11/21/2011 06:24 PM, Konstantin Svist wrote:
> Подскажите пожалуйста, как такое лечится
> Я хочу вытащить хэдеры из lua subrequest. Вроде по документации они
> должны сидеть в res.header, но там я только вижу ["Content-Type"] =
> "application/octet-stream";
>
>
>
> location /foo {
> content_by_lua 'local res = ngx.location.capture("/bar");
> ngx.print(res.header["Foo"])';
> }
> location /bar {
> echo "baz";
> add_header "Foo" "Bar";
> }
>
>
>
> $ curl -v 'http://localhost/foo'
> * About to connect() to localhost port 80 (#0)
> * Trying 127.0.0.1... connected
> * Connected to localhost (127.0.0.1) port 80 (#0)
> > GET /foo HTTP/1.1
> > User-Agent: curl/7.21.3-DEV (x86_64-unknown-linux-gnu)
> libcurl/7.21.3-DEV OpenSSL/1.0.0 zlib/1.2.5 libssh2/1.2.4
> > Host: localhost
> > Accept: */*
> >
> < HTTP/1.1 200 OK
> < Server:
> < Date: Tue, 22 Nov 2011 02:18:18 GMT
> < Content-Type: application/octet-stream
> < Transfer-Encoding: chunked
> < Connection: keep-alive
> <
> * Connection #0 to host localhost left intact
> * Closing connection #0
> nil#
>
>
>
> $ curl -v 'http://localhost/bar'
> * About to connect() to localhost port 80 (#0)
> * Trying 127.0.0.1... connected
> * Connected to localhost (127.0.0.1) port 80 (#0)
> > GET /bar HTTP/1.1
> > User-Agent: curl/7.21.3-DEV (x86_64-unknown-linux-gnu)
> libcurl/7.21.3-DEV OpenSSL/1.0.0 zlib/1.2.5 libssh2/1.2.4
> > Host: localhost
> > Accept: */*
> >
> < HTTP/1.1 200 OK
> < Server:
> < Date: Tue, 22 Nov 2011 02:17:38 GMT
> < Content-Type: application/octet-stream
> < Transfer-Encoding: chunked
> < Connection: keep-alive
> < Foo: Bar
> <
> baz
> * Connection #0 to host localhost left intact
> * Closing connection #0
>
>

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

subrequest headers ignored

Konstantin Svist November 21, 2011 09:26PM

[SOLVED] Re: subrequest headers ignored

Konstantin Svist November 22, 2011 05:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 130
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