Replies: 2 comments 4 replies
-
Hi, similiar question: Just tried next/image with manually configured (remote) domains out. But I get 401, because the remote domain needs a special header. I guess, it is not possible to configure this at the moment? I'm using next 12. |
Beta Was this translation helpful? Give feedback.
4 replies
-
Not sure why this was closed without comment, but I'd be interested in this as well. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When working with the
next/images
component images are optimized and compiled on built time, which is awesome!I would still love it though if it was possible either through a prop of the component, or a setting inside next.config.json to define headers that are used to request the images originally.
This would allow you to use an auth token for your images, which is used during build time only. This way you can protect your backend which is not meant to be accessed directly.
My idea could be implemented in various ways:
next.config.json
next.config.json
(i.e.domains: [{name: "mydomain.com", options: { imagesHeaders: { Auth: `Bearer ${process.env.MYDOMAIN_IMAGES_HEADER}` } }}]
)Beta Was this translation helpful? Give feedback.
All reactions