Skip to content
Discussion options

You must be logged in to vote

You are right to worry about this. A public image optimizer endpoint is effectively a small image-processing API, so you need limits around it.

With the default IPX provider, the first line of defense is to restrict what can be fetched:

export default defineNuxtConfig({
  runtimeConfig: {
    ipx: {
      domains: ["your-cdn.example.com"],
      alias: {
        images: "https://your-cdn.example.com/images",
      },
    },
  },
})

That prevents the endpoint from becoming an open proxy, but it does not fully solve abuse via huge resize/modifier combinations.

For that, I would add one or more of these:

  • put a CDN/WAF/rate limit in front of /_ipx/**
  • cache optimized results aggressively
  • only…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@adrianrudnik
Comment options

Answer selected by adrianrudnik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants