The API returns each item's image as an API-relative path, e.g. media.main_image: "/v1/items/{uuid}/image". The storefront puts that path straight into <img src>, so the browser asks the storefront's own origin (/v1/…) instead of the API behind /api. nginx answers with index.html, and every product card, product page and cart line shows a broken or empty image, even for items that have an uploaded image.
Reproduce: upload an image for an item (PUT /v1/items/{uuid}/image), open /shop: the image is broken; curl localhost:4300/api/v1/items/{uuid}/image returns the PNG.
Expected once solved: API-relative media paths (main_image and gallery) are resolved against the configured apiUrl when items are loaded, so product images show on the shop grid, product page and cart; absolute URLs are left untouched; a unit test fails if the mapping regresses.
The API returns each item's image as an API-relative path, e.g.
media.main_image: "/v1/items/{uuid}/image". The storefront puts that path straight into<img src>, so the browser asks the storefront's own origin (/v1/…) instead of the API behind/api. nginx answers withindex.html, and every product card, product page and cart line shows a broken or empty image, even for items that have an uploaded image.Reproduce: upload an image for an item (
PUT /v1/items/{uuid}/image), open/shop: the image is broken;curl localhost:4300/api/v1/items/{uuid}/imagereturns the PNG.Expected once solved: API-relative media paths (
main_imageandgallery) are resolved against the configuredapiUrlwhen items are loaded, so product images show on the shop grid, product page and cart; absolute URLs are left untouched; a unit test fails if the mapping regresses.