Mailing List Archive

Simple VCL help?
Hello fellow Varnish users-

I hope this is not a redundant question, but I do have a simple question
for a Varnish config:


I am running Word-press behind a varnish cluster and everything works
great. I do seem to have one simple issue.


I want to allow a "pass" for Woo-commerce login which looks like this:

*/?page_id=1955&edit-account*


My current vcl to pass logins for Word-press looks like:




*sub vcl_recv { if (req.url ~ "wp-admin|wp-login") { return (pass);} *


I just want to add the */?page_id=1955&edit-account* to the above so users
can alo log in via that page as well.

Is this possible?


Thank you,
Alex
Re: Simple VCL help? [ In reply to ]
Hi Alex,

You can do:


*sub vcl_recv {*
* if (req.url ~ "wp-admin|wp-login" ||*
* (req.url ~ "*[^?]+\?([^&]*&)*page_id=1955(&|$)*") && *
[^?]+\?([^&]*&)*edit-account(&|$)*) {*
* return (pass);*
* }*
*} *


There are vmods to handle this more cleanly, but this regex approach will
work everywhere.

--
Guillaume Quintard


On Tue, Nov 26, 2019 at 6:57 AM Alex Evonosky <alex.evonosky@gmail.com>
wrote:

> Hello fellow Varnish users-
>
> I hope this is not a redundant question, but I do have a simple question
> for a Varnish config:
>
>
> I am running Word-press behind a varnish cluster and everything works
> great. I do seem to have one simple issue.
>
>
> I want to allow a "pass" for Woo-commerce login which looks like this:
>
> */?page_id=1955&edit-account*
>
>
> My current vcl to pass logins for Word-press looks like:
>
>
>
>
> *sub vcl_recv { if (req.url ~ "wp-admin|wp-login") { return (pass);} *
>
>
> I just want to add the */?page_id=1955&edit-account* to the above so
> users can alo log in via that page as well.
>
> Is this possible?
>
>
> Thank you,
> Alex
>
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
Re: Simple VCL help? [ In reply to ]
Thank you Guillaume!!

Alex

On Tue, Nov 26, 2019 at 10:12 AM Guillaume Quintard <
guillaume@varnish-software.com> wrote:

> Hi Alex,
>
> You can do:
>
>
> *sub vcl_recv {*
> * if (req.url ~ "wp-admin|wp-login" ||*
> * (req.url ~ "*[^?]+\?([^&]*&)*page_id=1955(&|$)*") && *
> [^?]+\?([^&]*&)*edit-account(&|$)*) {*
> * return (pass);*
> * }*
> *} *
>
>
> There are vmods to handle this more cleanly, but this regex approach will
> work everywhere.
>
> --
> Guillaume Quintard
>
>
> On Tue, Nov 26, 2019 at 6:57 AM Alex Evonosky <alex.evonosky@gmail.com>
> wrote:
>
>> Hello fellow Varnish users-
>>
>> I hope this is not a redundant question, but I do have a simple question
>> for a Varnish config:
>>
>>
>> I am running Word-press behind a varnish cluster and everything works
>> great. I do seem to have one simple issue.
>>
>>
>> I want to allow a "pass" for Woo-commerce login which looks like this:
>>
>> */?page_id=1955&edit-account*
>>
>>
>> My current vcl to pass logins for Word-press looks like:
>>
>>
>>
>>
>> *sub vcl_recv { if (req.url ~ "wp-admin|wp-login") { return (pass);} *
>>
>>
>> I just want to add the */?page_id=1955&edit-account* to the above so
>> users can alo log in via that page as well.
>>
>> Is this possible?
>>
>>
>> Thank you,
>> Alex
>>
>>
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc@varnish-cache.org
>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>
>
Re: Simple VCL help? [ In reply to ]
getting:

VCL compilation failed
Error:
Message from VCC-compiler:
Syntax error at
('/etc/varnish/default.vcl' Line 72 Pos 92)
if (req.url ~ "wp-admin|wp-login" || (req.url ~
"[^?]+\?([^&]*&)*page_id=1955(&|$)") && [^?]+\?([^&]*&)*edit-account(&|$)) {
-------------------------------------------------------------------------------------------#-----------------------------------

Running VCC-compiler failed, exited with 2
VCL compilation failed



On Tue, Nov 26, 2019 at 10:12 AM Guillaume Quintard <
guillaume@varnish-software.com> wrote:

> Hi Alex,
>
> You can do:
>
>
> *sub vcl_recv {*
> * if (req.url ~ "wp-admin|wp-login" ||*
> * (req.url ~ "*[^?]+\?([^&]*&)*page_id=1955(&|$)*") && *
> [^?]+\?([^&]*&)*edit-account(&|$)*) {*
> * return (pass);*
> * }*
> *} *
>
>
> There are vmods to handle this more cleanly, but this regex approach will
> work everywhere.
>
> --
> Guillaume Quintard
>
>
> On Tue, Nov 26, 2019 at 6:57 AM Alex Evonosky <alex.evonosky@gmail.com>
> wrote:
>
>> Hello fellow Varnish users-
>>
>> I hope this is not a redundant question, but I do have a simple question
>> for a Varnish config:
>>
>>
>> I am running Word-press behind a varnish cluster and everything works
>> great. I do seem to have one simple issue.
>>
>>
>> I want to allow a "pass" for Woo-commerce login which looks like this:
>>
>> */?page_id=1955&edit-account*
>>
>>
>> My current vcl to pass logins for Word-press looks like:
>>
>>
>>
>>
>> *sub vcl_recv { if (req.url ~ "wp-admin|wp-login") { return (pass);} *
>>
>>
>> I just want to add the */?page_id=1955&edit-account* to the above so
>> users can alo log in via that page as well.
>>
>> Is this possible?
>>
>>
>> Thank you,
>> Alex
>>
>>
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc@varnish-cache.org
>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>
>
Re: Simple VCL help? [ In reply to ]
sorry, forgot to add:

vcl 4.1;



On Tue, Nov 26, 2019 at 12:49 PM Alex Evonosky <alex.evonosky@gmail.com>
wrote:

> getting:
>
> VCL compilation failed
> Error:
> Message from VCC-compiler:
> Syntax error at
> ('/etc/varnish/default.vcl' Line 72 Pos 92)
> if (req.url ~ "wp-admin|wp-login" || (req.url ~
> "[^?]+\?([^&]*&)*page_id=1955(&|$)") && [^?]+\?([^&]*&)*edit-account(&|$)) {
>
> -------------------------------------------------------------------------------------------#-----------------------------------
>
> Running VCC-compiler failed, exited with 2
> VCL compilation failed
>
>
>
> On Tue, Nov 26, 2019 at 10:12 AM Guillaume Quintard <
> guillaume@varnish-software.com> wrote:
>
>> Hi Alex,
>>
>> You can do:
>>
>>
>> *sub vcl_recv {*
>> * if (req.url ~ "wp-admin|wp-login" ||*
>> * (req.url ~ "*[^?]+\?([^&]*&)*page_id=1955(&|$)*") && *
>> [^?]+\?([^&]*&)*edit-account(&|$)*) {*
>> * return (pass);*
>> * }*
>> *} *
>>
>>
>> There are vmods to handle this more cleanly, but this regex approach will
>> work everywhere.
>>
>> --
>> Guillaume Quintard
>>
>>
>> On Tue, Nov 26, 2019 at 6:57 AM Alex Evonosky <alex.evonosky@gmail.com>
>> wrote:
>>
>>> Hello fellow Varnish users-
>>>
>>> I hope this is not a redundant question, but I do have a simple question
>>> for a Varnish config:
>>>
>>>
>>> I am running Word-press behind a varnish cluster and everything works
>>> great. I do seem to have one simple issue.
>>>
>>>
>>> I want to allow a "pass" for Woo-commerce login which looks like this:
>>>
>>> */?page_id=1955&edit-account*
>>>
>>>
>>> My current vcl to pass logins for Word-press looks like:
>>>
>>>
>>>
>>>
>>> *sub vcl_recv { if (req.url ~ "wp-admin|wp-login") { return
>>> (pass);} *
>>>
>>>
>>> I just want to add the */?page_id=1955&edit-account* to the above so
>>> users can alo log in via that page as well.
>>>
>>> Is this possible?
>>>
>>>
>>> Thank you,
>>> Alex
>>>
>>>
>>> _______________________________________________
>>> varnish-misc mailing list
>>> varnish-misc@varnish-cache.org
>>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>>
>>
Re: Simple VCL help? [ In reply to ]
Does this require some import as well?



On Tue, Nov 26, 2019 at 10:12 AM Guillaume Quintard <
guillaume@varnish-software.com> wrote:

> Hi Alex,
>
> You can do:
>
>
> *sub vcl_recv {*
> * if (req.url ~ "wp-admin|wp-login" ||*
> * (req.url ~ "*[^?]+\?([^&]*&)*page_id=1955(&|$)*") && *
> [^?]+\?([^&]*&)*edit-account(&|$)*) {*
> * return (pass);*
> * }*
> *} *
>
>
> There are vmods to handle this more cleanly, but this regex approach will
> work everywhere.
>
> --
> Guillaume Quintard
>
>
> On Tue, Nov 26, 2019 at 6:57 AM Alex Evonosky <alex.evonosky@gmail.com>
> wrote:
>
>> Hello fellow Varnish users-
>>
>> I hope this is not a redundant question, but I do have a simple question
>> for a Varnish config:
>>
>>
>> I am running Word-press behind a varnish cluster and everything works
>> great. I do seem to have one simple issue.
>>
>>
>> I want to allow a "pass" for Woo-commerce login which looks like this:
>>
>> */?page_id=1955&edit-account*
>>
>>
>> My current vcl to pass logins for Word-press looks like:
>>
>>
>>
>>
>> *sub vcl_recv { if (req.url ~ "wp-admin|wp-login") { return (pass);} *
>>
>>
>> I just want to add the */?page_id=1955&edit-account* to the above so
>> users can alo log in via that page as well.
>>
>> Is this possible?
>>
>>
>> Thank you,
>> Alex
>>
>>
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc@varnish-cache.org
>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>
>
Re: Simple VCL help? [ In reply to ]
my bad, I missed a couple of things on the second test:

sub vcl_recv {
if (req.url ~ "wp-admin|wp-login" ||
(req.url ~ "[^?]+\?([^&]*&)*page_id=1955(&|$)" && req.url ~
"[^?]+\?([^&]*&)*edit-account(&|$)")) {
return (pass);
}
}


sorry about that

--
Guillaume Quintard


On Wed, Nov 27, 2019 at 7:50 PM Alex Evonosky <alex.evonosky@gmail.com>
wrote:

> Does this require some import as well?
>
>
>
> On Tue, Nov 26, 2019 at 10:12 AM Guillaume Quintard <
> guillaume@varnish-software.com> wrote:
>
>> Hi Alex,
>>
>> You can do:
>>
>>
>> *sub vcl_recv {*
>> * if (req.url ~ "wp-admin|wp-login" ||*
>> * (req.url ~ "*[^?]+\?([^&]*&)*page_id=1955(&|$)*") && *
>> [^?]+\?([^&]*&)*edit-account(&|$)*) {*
>> * return (pass);*
>> * }*
>> *} *
>>
>>
>> There are vmods to handle this more cleanly, but this regex approach will
>> work everywhere.
>>
>> --
>> Guillaume Quintard
>>
>>
>> On Tue, Nov 26, 2019 at 6:57 AM Alex Evonosky <alex.evonosky@gmail.com>
>> wrote:
>>
>>> Hello fellow Varnish users-
>>>
>>> I hope this is not a redundant question, but I do have a simple question
>>> for a Varnish config:
>>>
>>>
>>> I am running Word-press behind a varnish cluster and everything works
>>> great. I do seem to have one simple issue.
>>>
>>>
>>> I want to allow a "pass" for Woo-commerce login which looks like this:
>>>
>>> */?page_id=1955&edit-account*
>>>
>>>
>>> My current vcl to pass logins for Word-press looks like:
>>>
>>>
>>>
>>>
>>> *sub vcl_recv { if (req.url ~ "wp-admin|wp-login") { return
>>> (pass);} *
>>>
>>>
>>> I just want to add the */?page_id=1955&edit-account* to the above so
>>> users can alo log in via that page as well.
>>>
>>> Is this possible?
>>>
>>>
>>> Thank you,
>>> Alex
>>>
>>>
>>> _______________________________________________
>>> varnish-misc mailing list
>>> varnish-misc@varnish-cache.org
>>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>>
>>
Re: Simple VCL help? [ In reply to ]
Thank you Guillaume for the response.. the VCL parsed without issue,
however it did not solve my problem. I just used HAproxy to route around
Varnish for that one login page.

thank you again!

Alex

On Thu, Nov 28, 2019 at 1:25 AM Guillaume Quintard <
guillaume@varnish-software.com> wrote:

> my bad, I missed a couple of things on the second test:
>
> sub vcl_recv {
> if (req.url ~ "wp-admin|wp-login" ||
> (req.url ~ "[^?]+\?([^&]*&)*page_id=1955(&|$)" && req.url ~
> "[^?]+\?([^&]*&)*edit-account(&|$)")) {
> return (pass);
> }
> }
>
>
> sorry about that
>
> --
> Guillaume Quintard
>
>
> On Wed, Nov 27, 2019 at 7:50 PM Alex Evonosky <alex.evonosky@gmail.com>
> wrote:
>
>> Does this require some import as well?
>>
>>
>>
>> On Tue, Nov 26, 2019 at 10:12 AM Guillaume Quintard <
>> guillaume@varnish-software.com> wrote:
>>
>>> Hi Alex,
>>>
>>> You can do:
>>>
>>>
>>> *sub vcl_recv {*
>>> * if (req.url ~ "wp-admin|wp-login" ||*
>>> * (req.url ~ "*[^?]+\?([^&]*&)*page_id=1955(&|$)*") && *
>>> [^?]+\?([^&]*&)*edit-account(&|$)*) {*
>>> * return (pass);*
>>> * }*
>>> *} *
>>>
>>>
>>> There are vmods to handle this more cleanly, but this regex approach
>>> will work everywhere.
>>>
>>> --
>>> Guillaume Quintard
>>>
>>>
>>> On Tue, Nov 26, 2019 at 6:57 AM Alex Evonosky <alex.evonosky@gmail.com>
>>> wrote:
>>>
>>>> Hello fellow Varnish users-
>>>>
>>>> I hope this is not a redundant question, but I do have a simple
>>>> question for a Varnish config:
>>>>
>>>>
>>>> I am running Word-press behind a varnish cluster and everything works
>>>> great. I do seem to have one simple issue.
>>>>
>>>>
>>>> I want to allow a "pass" for Woo-commerce login which looks like this:
>>>>
>>>> */?page_id=1955&edit-account*
>>>>
>>>>
>>>> My current vcl to pass logins for Word-press looks like:
>>>>
>>>>
>>>>
>>>>
>>>> *sub vcl_recv { if (req.url ~ "wp-admin|wp-login") { return
>>>> (pass);} *
>>>>
>>>>
>>>> I just want to add the */?page_id=1955&edit-account* to the above so
>>>> users can alo log in via that page as well.
>>>>
>>>> Is this possible?
>>>>
>>>>
>>>> Thank you,
>>>> Alex
>>>>
>>>>
>>>> _______________________________________________
>>>> varnish-misc mailing list
>>>> varnish-misc@varnish-cache.org
>>>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>>>
>>>