8000 Nuxt Image (_ipx) Not Working Externally with PM2 & Nginx · Issue #1711 · nuxt/image · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Nuxt Image (_ipx) Not Working Externally with PM2 & Nginx #1711
Open
@Trevor-Okwirri

Description

@Trevor-Okwirri

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    details-neededUse when additional details are needed by the issue author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0