1
0
Fork 0
mirror of https://github.com/docker/awesome-compose.git synced 2025-04-28 23:31:47 +02:00

adding nginx-wsgi-flask docker-compose sample

Signed-off-by: grantbirki <grant.birkinbine@gmail.com>
Signed-off-by: Grant Birkinbine <grant.birkinbine@gmail.com>
This commit is contained in:
grantbirki 2021-03-14 12:06:04 -07:00 committed by Grant Birkinbine
parent 017fd26b54
commit 55225b5e5c
No known key found for this signature in database
GPG key ID: B0409256808CFF4A
11 changed files with 335 additions and 0 deletions

View file

@ -0,0 +1,29 @@
proxy_cache_path /tmp/cache levels=1:2 keys_zone=cache:10m max_size=500m inactive=60m use_temp_path=off;
server {
listen 80;
location / {
proxy_pass http://$FLASK_SERVER_ADDR;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /cache-me {
proxy_pass http://$FLASK_SERVER_ADDR;
proxy_cache cache;
proxy_cache_lock on;
proxy_cache_valid 200 30s;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_revalidate on;
proxy_cache_background_update on;
expires 20s;
}
location /health-check {
add_header Content-Type text/plain;
return 200 "success";
}
}