Hello!
On Fri, Nov 6, 2015 at 2:01 AM, Google User wrote:
> I am currently using Tengine-2.1.1 (nginx-1.6.2) and memc-srcache+php-fpm.
>
> In case of srcache (v0.30), I'm having problem with the PHP-BBS cookies,
> some other login/logout issues.
>
> I've tried to explain below this issue as well as any non-native English.
> Any help would be greatly appreciated.
>
First of all, Tengine is not an officially supported target of the
ngx_srcache and ngx_memc modules. Only the official NGINX distribution
and the bundled version of the NGINX core in the OpenResty bundle are
officially supported.
Regarding your issue, it seems that you're not doing the processing
order right. srcache_fetch runs in the post-access request processing
phase of nginx, which is always before the content phase where your
fastcgi/php stuff runs. For contents requiring authentications, you
should move the session authentication code to an earlier phase
running before srcache_fetch (like with auth_request [1] or
access_by_lua* [2]). Furthermore, you should always encode the session
ID (or user ID) into the cache key used for caching (with ngx_srcache)
such that different users get different copies of the contents in the
cache.
Regards,
-agentzh
[1] http://nginx.org/en/docs/http/ngx_http_auth_request_module.html#auth_request
[2] https://github.com/openresty/lua-nginx-module#access_by_lua