We have a setup with a public facing NGINX reverse proxy that sets the head X-Magento-Store
and the shop instance on an apache Vhost
in apache I added
SetEnv MAGE_RUN_TYPE "store"
SetEnvIfNoCase X-Magento-Store ^english$ MAGE_RUN_CODE=english
SetEnvIfNoCase X-Magento-Store ^italian$ MAGE_RUN_CODE=italian
And every thing works fine as long as full_page cache is off.
If full_page cache is on, and I open the Italian URL www.example.com/it-it/shop first, the Italian start page is also shown when opening www.example.com/en_gb/shop and vice versa.
So it seems to me that the store code is missing in the full_page cache key some how, but why?
Steps to reproduce, without proxy setup:
1) In pub/.htaccess
set
SetEnv MAGE_RUN_TYPE store SetEnv MAGE_RUN_CODE italy
2) Now open Frontend
3) Now set
SetEnv MAGE_RUN_TYPE store SetEnv MAGE_RUN_CODE english
4) Now Open frontend, same URL
-> Italian version is displayed
Debugging
Setting break point in \Magento\Framework\App\PageCache\Kernel::load