default.conf 757 B

1234567891011121314151617181920212223242526272829
  1. proxy_cache_path /tmp/cache levels=1:2 keys_zone=cache:10m max_size=500m inactive=60m use_temp_path=off;
  2. server {
  3. listen 80;
  4. location / {
  5. proxy_pass http://$FLASK_SERVER_ADDR;
  6. proxy_set_header Host $host;
  7. proxy_set_header X-Real-IP $remote_addr;
  8. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  9. }
  10. location /cache-me {
  11. proxy_pass http://$FLASK_SERVER_ADDR;
  12. proxy_cache cache;
  13. proxy_cache_lock on;
  14. proxy_cache_valid 200 30s;
  15. proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
  16. proxy_cache_revalidate on;
  17. proxy_cache_background_update on;
  18. expires 20s;
  19. }
  20. location /health-check {
  21. add_header Content-Type text/plain;
  22. return 200 "success";
  23. }
  24. }