image: IPX error 404's serving images through NGINX on SSR site
- I setup NGINX in proxy mode with the exact config file as described here (first snippet of code, with my own domain name in the
server_namefield). - Nuxt runs in SSR mode (not static).
"@nuxt/image": "^0.7.0"is added in the dependencies inpackage.json.- I also explicitly included
"ipx": "^0.9.11"inpackage.json. - All images in my project are located in (the default)
/static/imgso I have not setup the custom serverMiddleware (I tried that too, but that didn’t work either, BTW), as describe here.
Now when I open my project in a browser through my domain name, all loads fine except the images with the nuxt-image tag that are to be served through IPX. All of them keep returning “404 Not Found”. The request are made to <my domain>/_ipx/img/base/logo.png, for instance. All works fine on my development machine.
What am I missing? I thought it might have something to do with my NGINX config, but when I request time image URL with CURL directly on the server itself with curl -v "http://localhost:3000/_ipx/img/base/logo.png" I also get a 404.
Update: I also tried by simply running the Nuxt app on my local machine in production mode and then the IPX requests fail as well.
(BTW, I also tried a deployment as a Digital Ocean App, exactly as described here but that exhibits the exact same problem).
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 13
- Comments: 28
@DaDlugosch I gave up for the moment and am using
<img>tags. Not a great option, but until someone addresses this, I’m not sure what else to do. I don’t understand the low-level parts enough at the moment to open up a PR.Ok, I found a workaround: I’m now using the free tier of imgix.com, following this guide. Extremely silly that I need to go through an external provider to get the images of my production server, but it works. I still hope this gets fixed very soon so that IPX works in production mode, just like it works in development mode.
I’m having this issue as well using the Azure static website template and using @nuxt/image": “^1.0.0-rc.1”. Is it broken for everyone or am I missing a guide maybe? Works fine locally.
I think I am seeing the same sort of issue when I deploy to azure static web apps. https://[site].azurestaticapps.net/_ipx/w_4096/images/feature/FeatureX.png yields IPX Error: Error: File not found (/home/site/public/images/feature/FeatureX.png)
I have the same issue, none of my images work with nuxt-img, here is example
<nuxt-img loading="lazy" class="w-80 inline-block max-w-full max-h-full" src="~assets/images/about/pub1.svg" alt="" />it returns 404 for dev and in production.