32 lines
1.1 KiB
Django/Jinja
32 lines
1.1 KiB
Django/Jinja
proxy_cache_path {{ ara.deployment.nginx.cache_directory }} levels=1:2
|
|
keys_zone=ara:5m max_size=1g inactive=1d use_temp_path=off;
|
|
|
|
upstream ara {
|
|
server {{ ara.config.host }}:{{ ara.config.port }};
|
|
}
|
|
|
|
server {
|
|
listen {{ ara.config.proxy_port }};
|
|
server_name {{ ara.config.proxy_host }};
|
|
access_log /var/log/nginx/ara_access.log;
|
|
error_log /var/log/nginx/ara_error.log;
|
|
|
|
location {{ ara.config.application_root }} {
|
|
# Define the location of the proxy server to send the request to
|
|
proxy_pass http://ara;
|
|
|
|
# Redefine the header fields that NGINX sends to the upstream server
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_cache ara;
|
|
proxy_cache_revalidate on;
|
|
proxy_cache_valid any 15m;
|
|
proxy_cache_min_uses 1;
|
|
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
|
|
proxy_cache_background_update on;
|
|
proxy_cache_lock on;
|
|
}
|
|
}
|