|
proxy_cache_path /var/cache/nginx/python levels=1:2 keys_zone=python_cache:10m inactive=60m; |
|
|
|
upstream python_server { |
|
server 10.90.0.170:32080; |
|
} |
|
|
|
server { |
|
listen 8083; |
|
server_name _; |
|
location / { |
|
include proxy_params; |
|
proxy_pass http://python_server; |
|
proxy_cache python_cache; |
|
proxy_cache_valid any 10m; |
|
proxy_set_header HOST $host; |
|
add_header X-Proxy-Cache $upstream_cache_status; |
|
|
|
proxy_cache_bypass $nocache; |
|
proxy_no_cache $nocache; |
|
|
|
set $nocache 0; |
|
|
|
if ($http_x_custom_header = "gzip") { |
|
set $nocache 1; |
|
add_header Cache-Control "no-store, no-cache, must-revalidate"; |
|
add_header X-Proxy-Cache $upstream_cache_status; |
|
} |
|
|
|
if ($http_x_galata_header = "galata") { |
|
set $nocache 1; |
|
add_header Cache-Control "no-store, no-cache, must-revalidate"; |
|
add_header X-Proxy-Cache $upstream_cache_status; |
|
} |
|
|
|
|
|
} |
|
} |