question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IPX error 404's serving images through NGINX on SSR site

See original GitHub issue
  • 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_name field).
  • Nuxt runs in SSR mode (not static).
  • "@nuxt/image": "^0.7.0" is added in the dependencies in package.json.
  • I also explicitly included "ipx": "^0.9.11" in package.json.
  • All images in my project are located in (the default) /static/img so 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).

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:5
  • Comments:14

github_iconTop GitHub Comments

1reaction
vedmantcommented, Oct 6, 2022

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.

1reaction
plindelaufcommented, Sep 30, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Image from a certain domain on my Nginx server loads fine in ...
I checked out my nginx error logs and this looks like it has something to do with the issue i'm having. The 403...
Read more >
404 error when navigating to image file NGINX - Stack Overflow
I want to be able to serve an image on the forum as a background but I cannot even get the server to...
Read more >
Variable VVV: Avoid 404 errors when loading images by proxy
Variable VVV: Avoid 404 errors when loading images by proxy · Step 1: Open the relevant NGINX configuration file · Step 2: Modify...
Read more >
Pitfalls and Common Mistakes | NGINX
Easy, right? Check if the requested URI exists and can be served by NGINX. If not, check if it is a directory that...
Read more >
How To Configure Nginx to Use Custom Error Pages on ...
Put your custom error pages in the /usr/share/nginx/html directory where Nginx sets its default document root. You'll make a page for 404 errors...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found