On CentOS7 and Cpanel with Mangeto 2.0.9 running on Apache I have installed and configured Varnish by moving Apache to 8080 port and SSL to 8888 (to disable). Then installed Nginx to listen on port 443 and redirect all to Varnish.
And it all works perfectly and Magento keeps everything https and the certificate is valid.
PROBLEM: var/cache and var/page_cache are always re-generated. Homepage always gives cache MISS and load time of 1.5 seconds.
Of course I have imported the Varnish 4 configuration from Magento Full page cache settings and changed it to work for Varnish, but var/ directory is still in use.
I have checked maybe every single article and guide and the most you can hear about var/page_cache is that if its not re-created then you're done, but what if it still is? Where to look?
I checked all Magento's var/log/(system|debug|exception).log's and nothing about there.
Any suggestion is welcomed! Thanks!
EDIT: This is env.php bottom part:
'x-frame-options' => 'SAMEORIGIN',
'MAGE_MODE' => 'developer',
'cache_types' =>
array (
'config' => 1,
'layout' => 1,
'block_html' => 1,
'collections' => 1,
'reflection' => 1,
'db_ddl' => 1,
'eav' => 1,
'config_integration' => 1,
'config_integration_api' => 1,
'full_page' => 1,
'translate' => 1,
'config_webservice' => 1,
'compiled_config' => 1,
),
EDIT: After changed to production mode via editing env.php and made
rm -rf var/*cache
the only thing changed is that response header
X-Magento-Cache-Debug: MISS
disappeared from the homepage request.