mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-26 10:43:35 +02:00
init nginx-wsgi-flask
Signed-off-by: Grant Birkinbine <grant.birkinbine@gmail.com>
This commit is contained in:
parent
a92c067f75
commit
7cf1cf4789
10 changed files with 312 additions and 0 deletions
29
nginx-wsgi-flask/nginx/default.conf
Normal file
29
nginx-wsgi-flask/nginx/default.conf
Normal 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";
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue