chore: enable cache/store cache on host/allow app takedown

This commit is contained in:
root 2021-08-31 11:44:01 +00:00
parent f167fcc520
commit fe5a0d8f5e
2 changed files with 9 additions and 11 deletions

View file

@ -37,10 +37,6 @@ http {
resolver 127.0.0.11 valid=30s;
upstream pokeapi_upstream {
server app:80 fail_timeout=0;
}
upstream graphql_upstream {
server graphql-engine:8080 fail_timeout=0;
}
@ -94,11 +90,11 @@ http {
location /graphql/v1beta {
proxy_read_timeout 70s;
# proxy_cache small;
# proxy_cache_valid 200 10d;
# proxy_cache_valid any 0;
# proxy_cache_methods POST;
# proxy_cache_key "$request_method$request_uri$request_body";
proxy_cache small;
proxy_cache_valid 200 10d;
proxy_cache_valid any 0;
proxy_cache_methods POST;
proxy_cache_key "$request_method$request_uri$request_body";
limit_req zone=graphqlDefaultLimit burst=100 nodelay;
limit_req_status 429;
expires 30m; # client-side caching, one minute for each API resource
@ -124,7 +120,8 @@ http {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://pokeapi_upstream;
set $upstream app;
proxy_pass http://$upstream:80;
}
location / {

View file

@ -43,7 +43,7 @@ services:
volumes:
- ./Resources/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./Resources/nginx/ssl:/ssl:ro
- graphql_cache:/tmp/cache
graphql-engine:
image: hasura/graphql-engine:v2.0.8
ports:
@ -65,3 +65,4 @@ services:
volumes:
pg_data:
redis_data:
graphql_cache: