Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Re: $upstream_http_* variables exist but do not seem to be readable

$
0
0
Hello!

On Fri, Feb 1, 2013 at 6:48 AM, Maxim Dounin wrote:
>> set_by_lua $use_token
>> '
>> if not ngx.var.sent_http_csrf == "" then
>> return ngx.var.upstream_http_csrf
>> end
>> return "baz"
>> '; # Always return 'baz'
>> add_header WIllThisWork $use_token; # Again, empty
>
> I'm not familiar with lua module, but likely the explanation is
> the same - set_by_lua is executed before a response is available.
>

Yes, set_by_lua runs at exactly the same phase of the standard
ngx_rewrite module's "set" directive. Actually set_by_lua is injected
into ngx_rewrite so that it can be mixed with other rewrite module
directives.

@shrikeh: you're recommended to read my Nginx tutorials to learn more
about the Nginx config directive running order:

http://openresty.org/#eBooks

Best regards,
-agentzh

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

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>