{"action":"created","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/3897","repository_url":"https://api.github.com/repos/magento/magento2","labels_url":"https://api.github.com/repos/magento/magento2/issues/3897/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/3897/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/3897/events","html_url":"https://github.com/magento/magento2/issues/3897","id":143598978,"number":3897,"title":"Varnish ESI blocks don't load when HTTPS is used site-wide","user":{"login":"erikhansen","id":129031,"avatar_url":"https://avatars.githubusercontent.com/u/129031?v=3","gravatar_id":"","url":"https://api.github.com/users/erikhansen","html_url":"https://github.com/erikhansen","followers_url":"https://api.github.com/users/erikhansen/followers","following_url":"https://api.github.com/users/erikhansen/following{/other_user}","gists_url":"https://api.github.com/users/erikhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/erikhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikhansen/subscriptions","organizations_url":"https://api.github.com/users/erikhansen/orgs","repos_url":"https://api.github.com/users/erikhansen/repos","events_url":"https://api.github.com/users/erikhansen/events{/privacy}","received_events_url":"https://api.github.com/users/erikhansen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/magento/magento2/labels/acknowledged","name":"acknowledged","color":"02d7e1"},{"url":"https://api.github.com/repos/magento/magento2/labels/PS","name":"PS","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-03-25T21:10:21Z","updated_at":"2016-04-19T18:26:30Z","closed_at":null,"body":"This issue is related to #2657 that the OP closed.\r\n\r\n# Steps to reproduce\r\n\r\n1. Install Magento 2.0.2 with sample data\r\n2. Configure all urls to load from HTTPS (e.g., set \"Base URL\" and \"Secure Base URL\" to https://example.dev)\r\n3. Load frontend and you'll see the navigation present.\r\n4. Configure and enable Varnish ([see documentation](http://devdocs.magento.com/guides/v2.0/config-guide/varnish/config-varnish.html))\r\n5. Load the frontend and you'll see the main navigation is missing: \r\n![test_and_purging_and_banning_ _varnish_version_3_0_7_documentation](https://cloud.githubusercontent.com/assets/129031/14053909/be3b1b28-f2a2-11e5-96e2-1f5063d4e202.png)\r\n\r\n# Potential Solutions\r\n\r\n## 1. Modify Varnish ESI to ignore HTTPS\r\n\r\nPer this [Stack Exchange answer](http://magento.stackexchange.com/a/100128/2142), if you modify your /etc/sysconfig/varnish file and add `-p feature=+esi_ignore_https` to the arguments passed to Varnish, the problem will be solved. For example:\r\n\r\n```\r\nDAEMON_OPTS=\"-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \\\r\n             -f ${VARNISH_VCL_CONF} \\\r\n             -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \\\r\n             -p feature=+esi_ignore_https \\\r\n             -p thread_pool_min=${VARNISH_MIN_THREADS} \\\r\n             -p thread_pool_max=${VARNISH_MAX_THREADS} \\\r\n             -S ${VARNISH_SECRET_FILE} \\\r\n             -s ${VARNISH_STORAGE}\"\r\n```\r\n\r\nThis solution is merely a workaround for the fact that Magento 2 returns HTTPS urls as ESI urls. Also, this option is only available in Varnish 4.\r\n\r\n## 2. Modify Magento's \\Magento\\PageCache\\Observer\\ProcessLayoutRenderElement::_wrapEsi method to never return HTTP urls\r\n\r\nPer the #2657 issue raised by @boldhedgehog, the proper solution is to modify Magento to only return HTTP urls to Varnish. How exactly this is handled is up for discussion, as I don't think it would be proper to simply replace \"https\" with \"https\"."},"comment":{"url":"https://api.github.com/repos/magento/magento2/issues/comments/212056420","html_url":"https://github.com/magento/magento2/issues/3897#issuecomment-212056420","issue_url":"https://api.github.com/repos/magento/magento2/issues/3897","id":212056420,"user":{"login":"davidalger","id":658281,"avatar_url":"https://avatars.githubusercontent.com/u/658281?v=3","gravatar_id":"","url":"https://api.github.com/users/davidalger","html_url":"https://github.com/davidalger","followers_url":"https://api.github.com/users/davidalger/followers","following_url":"https://api.github.com/users/davidalger/following{/other_user}","gists_url":"https://api.github.com/users/davidalger/gists{/gist_id}","starred_url":"https://api.github.com/users/davidalger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidalger/subscriptions","organizations_url":"https://api.github.com/users/davidalger/orgs","repos_url":"https://api.github.com/users/davidalger/repos","events_url":"https://api.github.com/users/davidalger/events{/privacy}","received_events_url":"https://api.github.com/users/davidalger/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T18:26:30Z","updated_at":"2016-04-19T18:26:30Z","body":"@rip057 That is really a question better suited for the forums, as we need to keep the issue tracker on it's core focus, technical issues / bugs with the Magento 2 platform. I would recommend you take that over to  the [Community Forums](https://community.magento.com) or [Magento Stack Exchange](http://magento.stackexchange.com/) site. Thanks!"}}