Varnish not purging via Magento 2 - throwing 403 Forbidden error - help please

John Risby john at alcoholfree.co.uk
Tue Apr 5 20:21:00 CEST 2016


Ok, I've found a workaround to this problem on another forum.


For anyone else with the same problem, see the post by davidalger at
https://www.bountysource.com/issues/29113272-no-varnish-purge-request-from-nginx


This fixes it. Basically the server path isn't being set properly and this
code fixes it. Hopefully (presumably?) it will be added to the core
codebase a some point.


That solves the main problem of the varnish cache not clearing from the
Magento 2 admin, but I'm still unsure why /app/etc/config.php is being
requested after that.


So basically it's a Magento problem, not a Varnish problem. Thanks for your
help.


Thanks


On 4 April 2016 at 09:59, John Risby <john at alcoholfree.co.uk> wrote:

> Great, thanks Per. That's helped narrow it down. I'll check the Magento
> code and see what it is doing. Should hopefully be simple to fix.
>
> Don't worry about the second bit, as long as it purges the cache, that's
> the main thing.
>
> Thank you
> John
>
>
> On 4 April 2016 at 09:57, Per Buer <perbu at varnish-software.com> wrote:
>
>>
>>
>> On Sun, Apr 3, 2016 at 8:56 PM, John Risby <john at alcoholfree.co.uk>
>> wrote:
>>
>>> Hi Per,
>>>
>>> Thanks for the reply.
>>>
>>> I'm sorry, I missed off the first part of the log which is
>>>
>>> *   << Request  >> 2
>>> -   Begin          req 1 rxreq
>>> -   Timestamp      Start: 1459708682.774223 0.000000 0.000000
>>> -   Timestamp      Req: 1459708682.774223 0.000000 0.000000
>>> -   HttpGarbage    "PURGE%00"
>>> -   ReqAcct        47 0 47 28 0 28
>>> -   End
>>>
>>
>>
>> Magento does something weird here. It says PURGE and then a null
>> character. It should be something PURGE /... HTTP/1.1.
>>
>> So check the magento config or the code that issues the purge.
>>
>> (..)
>>> 2) It's then trying to access /app/et/config.php but failing and
>>> returning 403. My vcl is generated from the Magento admin backend so should
>>> be right and the admin page where I'm flushing the cache is being accessed
>>> from https anyway, so shouldn't that mean it is totally ignored? This is a
>>> test server, so no one else is accessing the site and this request is
>>> consistent every time I hit Flush Magento Cache on the backend. Any idea
>>> why it is trying/failing to access this file?
>>>
>>
>> No, I don't. I don't know Magento. :-/
>>
>>
>> --
>> *Per Buer*
>> CTO | Varnish Software AS
>> Cell: +47 95839117
>> We Make Websites Fly!
>> www.varnish-software.com
>> <http://info.varnish-software.com/signature>
>>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20160405/d4e01f55/attachment.html>


More information about the varnish-misc mailing list