mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-10 06:04:18 +00:00
chore: enable cache/store cache on host/allow app takedown
This commit is contained in:
parent
f167fcc520
commit
fe5a0d8f5e
2 changed files with 9 additions and 11 deletions
|
@ -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 / {
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue