recv_misc_fixups.vcl 803 B

1234567891011121314151617181920
  1. # Remove all query arguments to increase cache hit ratios. This may need to be changed/undone in case Image Opto is used
  2. set req.url = querystring.remove(req.url);
  3. # Block any HTTP verbs on on the approved list. No need to forward that back to the origin
  4. if (req.request != "HEAD" && req.request != "GET" && req.request != "FASTLYPURGE") {
  5. error 404;
  6. }
  7. # We only serve static media files. Block everything else
  8. if (req.url.ext ~ "(?i)^(jpe?g|png|gif|mp4|mp3|gz|svg|avif|webp)$") {
  9. } else {
  10. error 404;
  11. }
  12. # Remove all headers we don't care to be passing around. It does not remove protected headers. More details
  13. # https://developer.fastly.com/reference/vcl/functions/headers/header-filter-except/
  14. # This causes a 301, need to investigate why first.
  15. #header.filter_except(req, "Accept-Encoding");