Closed edo888 closed 7 years ago
@edo888 You confused with the nginx directive running order. The set
directive runs in the rewrite phase, which means that they always run before the access_by_lua
directive which runs in the access phase, a later phase, no matter how you arrange them in the nginx.conf
file. Please read my nginx tutorials on the directive running order and nginx's running phases first to avoid such common mistakes for nginx freshmen:
https://openresty.org/download/agentzh-nginx-tutorials-en.html
Thanks for the clarification! It makes sense now. I have solved it by passing $mykey to srcache directly and doing the set on /memc location.
I have tried also by using rewrite_by_lua with rewrite_by_lua_no_postpone on, but as I've read further the order of the execution is undefined and I was not getting the desired result.
Thanks!
Hi,
I have the configuration below:
Where /my_test sub-request returns test2 with status code 200.
I expect the $key passed to memc to be set to test2, but it is always set to test.
I have read that access_by_lua runs in the end of access, while srcache_fetch runs post-access.
Could you explain this behavior?
P.S. Compliments for your amazing modules!!!
Thanks!