2015-08-16 35 views
0

我試圖允許登錄我的網站。所以我設置下清漆4在我的VCL如下:清漆編制失敗或聲明

# Allow the beta site to login 
    if (req.http.host ~ "^beta\.example\.com$" && req.url ~ "^?oa_social_login_source=custom$") { 
     return (pass); 
    } 

但是,當我去做的VCL我收到以下錯誤語法檢查:

#varnishd -C -f default.vcl 
Message from VCC-compiler: 
Regexp compilation error: 

nothing to repeat 

('input' Line 111 Pos 62) 
    if (req.http.host ~ "^beta\.example\.com$" && req.url ~ "^?oa_social_login_source=custom$") { 
-------------------------------------------------------------##################################---- 

Running VCC-compiler failed, exited with 2 

VCL compilation failed 

任何人可以幫助我關於我想要實現的語法?

感謝, 添

回答

1

你需要躲避問號 - 因爲這是正則表達式量詞的跡象。

req.url ~ "^\?oa_social_login_source=custom$"