We have a M2 multistore setup with 2 stores. One of the stores is called beta, the url of this domain is beta.mydomain.com. The admin domain url is admin.mydomain.com.
When I login to the admin, the thumbnail image url in the product grid should be admin.mydomain.com but instead it has the wrong url of beta.mydomain.com, resulting in not displaying the images. In product detail the thumbnail image looks fine.
Seems like the admin domain is not finding the correct domain (should be admin.mydomain.com) and for some reason chooses beta?
In nginx we put a mapping for default to '' and for beta to store: beta
Store selector on frontend is working fine.
What could be the issue?
Ensure correct base URLs:
Check your nginx configuration:
Flush image cache:
This sounds like an issue with the media URL generation in the Magento 2 multi-store setup.
A few things to check:
- In the Magento admin, under Stores > Configuration > General > Web, ensure the "Base Media URL" is set correctly to admin.mydomain.com for the default store view.
- Check if you have configured the media storage under different domain names for each store. The media storage should be on the same main domain (admin.mydomain.com).
- Verify that in your nginx config, the media folder is being mapped correctly to the admin.mydomain.com domain for all stores.
- Clear the cache and reindex to refresh the product image URLs.
- Check if any custom code is overriding the media URL generation for the product thumbnails specifically on the admin store.
- As a workaround, you can try setting the "Base Media URL" for the "beta" store view to also use admin.mydomain.com.
Usually the core issue is that the media URL is incorrectly configured or mapped for the multi-store setup. Going through the media configurations and verifying the domain mapping should help resolve it.