N
Nuxt3mo ago
Yuri

Hide real image's path for images IPX

2 Replies
kapa.ai
kapa.ai3mo ago
Hi @Yuri. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the knowledge sources do not provide a built-in way to hide or obfuscate the original image URL when using the IPX provider in Nuxt Image. By default, the IPX provider generates URLs that include the original image path, such as:
/_ipx/f_webp&w_460/<http://localhost:3000/uploads/IMG_3676_1_9f0d8493a1.jpg>
/_ipx/f_webp&w_460/<http://localhost:3000/uploads/IMG_3676_1_9f0d8493a1.jpg>
This means that the original image URL is exposed and accessible. The documentation does mention the use of the alias option, which can simplify and shorten external URLs in the generated image paths, but it does not hide or secure the original image path—it only makes the URL shorter and more convenient for usage:
export default defineNuxtConfig({
image: {
domains: [
'images.unsplash.com'
],
alias: {
unsplash: '<https://images.unsplash.com'>
}
}
})
export default defineNuxtConfig({
image: {
domains: [
'images.unsplash.com'
],
alias: {
unsplash: '<https://images.unsplash.com'>
}
}
})
Usage:
<NuxtImg src="/unsplash/<id>" />
<NuxtImg src="/unsplash/<id>" />
But this is for convenience and does not provide security or true obfuscation of the original image path alias option documentation. If you need to truly hide or protect the original image URLs, you would need to implement additional server-side logic or use a different approach, but there is no mention of such a feature in the official Nuxt Image or IPX documentation provided in the knowledge sources. Summary:
There is no built-in way in Nuxt Image's IPX provider to hide or obfuscate the original image path in the generated URLs according to the available documentation Providers: IPX alias option documentation. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@740173469404364872> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?