-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx_cbase_cache.conf
44 lines (41 loc) · 1.21 KB
/
nginx_cbase_cache.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
upstream img_cbase_backend {
server 127.0.0.1:11211;
keepalive 512;
}
#upstream web_backend {
# server @@REAL_SERVER@@:80;
#}
server {
listen 80;
#server_name @@SERVER_NAME@@;
root /var/www/html;
gzip on;
gzip_static on;
gzip_http_version 1.0;
gzip_vary on;
gzip_types text/plain application/x-javascript text/css application/xml text/xml;
#######deny list##########
include /etc/nginx/nginx_security.conf;
location = /memc {
internal;
memc_connect_timeout 100ms;
memc_send_timeout 100ms;
memc_read_timeout 100ms;
set $memc_key $query_string;
memc_pass img_cbase_backend;
}
location ~* "\.(jpg|png|css|js|xml)" {
#if ( !-e $request_filename ) {
# proxy_pass http://web_backend;
#}
#proxy_set_header Host $host;
##proxy_set_header Accept-Encoding "";
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $remote_addr;
set $key $cbase_memc_key;
srcache_fetch GET /memc $key;
srcache_store PUT /memc $key;
srcache_store_statuses 200 301 302;
add_header X-Ncache "TCP_$srcache_fetch_status";
}
}