Skip to content

Directives srcache_store_pass_header didn't work #72

@ricardo-ml

Description

@ricardo-ml

HI,
I use srcache-nginx with memcached. i read your "README.markdown" then i know by defult command "srcache_store PUT /memc $key" can't store if http header have "Connection:keepalive" . so i add command "srcache_store_pass_header" to force store, but it isn't work.

My nginx.conf:
location = /memc {
internal;
set $memc_key $query_string;
set $memc_exptime 600;
memc_pass 127.0.0.1:11211;
}

location / {
set $my_key $request_uri;
srcache_fetch GET /memc $my_key;
srcache_store PUT /memc $my_key;
srcache_methods GET HEAD POST;

srcache_store_pass_header Connection;
srcache_store_pass_header Set-Cookie;
srcache_store_pass_header Keep-Alive;
srcache_store_pass_header Proxy-Authenticate;
srcache_store_pass_header Proxy-Authorization;
srcache_store_pass_header TE;
srcache_store_pass_header Trailers;
srcache_store_pass_header Transfer-Encoding;
srcache_store_pass_header Upgrade;

add_header X-Cached $srcache_fetch_status;
proxy_pass http://web_servers;

}

Test Result( I already exec twice ):
[root@test ~]#curl -I http://192.168.0.214/a.html
HTTP/1.1 200 OK
Server: Nginx/1.8.1
Date: Tue, 03 Jul 2018 02:35:10 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 42
Connection: keep-alive
Last-Modified: Wed, 27 Jun 2018 07:08:38 GMT
ETag: "2a-56f9a48ab6919"
Accept-Ranges: bytes
X-Cached: MISS

Memcached Result:
[root@test ~]#telnet 127.0.0.1 11211
get /a.html
END

Can you help me to fix this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions