Files
nginx-cache/nginx.conf

46 lines
1.2 KiB
Nginx Configuration File

events {
worker_connections 1024;
}
http {
client_body_temp_path /etc/nginx/data/temp;
proxy_temp_path /etc/nginx/data/temp;
fastcgi_temp_path /etc/nginx/data/temp;
uwsgi_temp_path /etc/nginx/data/temp;
scgi_temp_path /etc/nginx/data/temp;
proxy_cache_path /etc/nginx/data/cache levels=1:2 keys_zone=api_cache:10m max_size=1g inactive=365d;
error_log /dev/stdout debug;
access_log /dev/stdout;
# Use Docker's internal DNS
resolver 127.0.0.11 valid=10s;
server {
listen 3001;
location / {
if ($arg_url = "") {
return 400 "Missing url parameter";
}
proxy_pass $arg_url;
proxy_http_version 1.1;
proxy_set_header Host $proxy_host;
proxy_ssl_server_name on;
proxy_cache api_cache;
proxy_cache_valid 200 365d;
proxy_cache_bypass $http_x_cache_this_inverse;
proxy_no_cache $http_x_cache_this_inverse;
set $http_x_cache_this_inverse 1;
if ($http_x_cache_this) {
set $http_x_cache_this_inverse 0;
}
add_header X-Cache-Status $upstream_cache_status always;
}
}
}