-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnginx-cache.conf
30 lines (25 loc) · 969 Bytes
/
nginx-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
proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=my_cache:5m max_size=1g inactive=30d use_temp_path=off;
log_format cachelog '$remote_addr - $remote_user [$time_local] "$request" '
'$status CACHE:$upstream_cache_status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
charset utf-8;
location / {
proxy_pass http://tstp:3000/;
}
location /dbrest/ {
proxy_cache my_cache;
proxy_cache_revalidate on;
proxy_ignore_headers Set-Cookie;
proxy_ignore_headers X-Accel-Expires;
proxy_ignore_headers Expires;
# proxy_ignore_headers Cache-Control;
proxy_cache_valid 200 30d;
proxy_ssl_server_name on;
proxy_pass https://v6.db.transport.rest/;
access_log /var/log/nginx/access.log cachelog;
}
}