Description
I'm running a Nuxt 3 app in production using PM2 (cluster mode) and Nginx as a reverse proxy. When making internal requests (curl -I http://localhost:3000/_ipx/_/logo/my-image.png), the image loads fine. However, when accessing externally (https://app.xyz.com/_ipx/_/logo/my-image.png), I get a 404 Not Found error.
This issue occurs only in production on external requests. But on internal request no issues. In development (npm run dev), images work fine.
Steps to Reproduce:
Start a Nuxt app with @nuxt/image using pm2 in cluster mode:
pm2 start ecosystem.config.js
Set up Nginx as a reverse proxy:
`server {
listen 80;
server_name app.xyz.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /_ipx/ {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Try accessing the image:
Works locally:
curl -I http://localhost:3000/_ipx/_/logo/my-image.png
Fails externally:
curl -I https://app.xyz.com/_ipx/_/logo/my-image.png