How to force cache almost all HTTP response like 404 and 403? This is my Nginx Config:
fastcgi_cache_path /tmp/nginx_fastcgi_cache levels=1:2 keys_zone=fastcgicache:200m inactive=30m;
fastcgi_cache_key $scheme$request_method$host$request_uri;
fastcgi_cache_lock on;
fastcgi_cache_use_stale error timeout invalid_header updating http_500;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
fastcgi_cache fastcgicache;
fastcgi_no_cache $nocachecookie;
fastcgi_cache_valid 200 202 301 302 404 403 10m;
add_header X-Cache $upstream_cache_status;
But 404 and 403 pages don’t have this header:
x-cache HIT or Bypass