File size: 694 Bytes
bd5d31b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
upstream webapp {
    server chatbot_api:5005;
}
proxy_cache_path /etc/nginx/conf.d/cache levels=1:2 keys_zone=cache_one:512m inactive=10m max_size=64m;
server {
    listen 5000;
    server_name localhost;

    location / {
        proxy_pass http://webapp;
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        add_header X-Cache $upstream_cache_status;
    
        #Set Nginx Cache
        
        
        proxy_ignore_headers Set-Cookie Cache-Control expires;
        proxy_cache cache_one;
        proxy_cache_key $host$uri$is_args$args;
        proxy_cache_valid 200 304 301 302 1m;
        expires 12h;
    }

}