@nisamudeen97
Maybe a bit late, but I just got my first cPanel VPS, so i a have no idea if you allready tried xVarnish (renamed to Cachewall) or not.
At this moment I have installed Cachewall (formerly xVarnish) and i'm blown away with how easy it was. The instructions are very simple and on the same level as installing ConfigServer on WHM/cPanel, only a few lines of code in the right order and you're done.
What I noticed was that my Apache security headers (i.e X-XSS-Protection and so on) where not served to the browser, which is actually not really unsurprising, since we now serve cached pages via Varnish.
After RTFVM (RTFVarnishM) I got a bit of an idea how one should accomplish this, but this didn't lead to any results. I then cowboy cd/ls'd the whole system and cd/ls'ed some more until I hit a file named vcl_deliver.vcl. This file is located in
/etc/varnish.conf.d/local
I added the code for my headers and then did a "service varnish restart", went to the WHM backend (in the browser) and purged the cache for my domain in the Cachewall UI.
One thing to note however is that the regular vcl syntax is the following:
Code:
sub vcl_deliver {
set resp.http.X-XSS-Protection = "1; mode=block";
rest of your code....
}
This won't work. What you need to do is remove
and just add:
Code:
set resp.http.X-XSS-Protection = "1; mode=block";
rest of your code....
save the file, restart varnish and purge cache via the WHM => Cachewall UI and your done.
Please also note that I have not yet received feedback from the xVarnish/Cachewall developers if this method is 100% correct. My guess is that it is save, because the vcl_deliver.vcl has a opening header with the following content in it:
Code:
# This VCL file will be included in the VCL sub-routine vcl_deliver.
#
# Custom VCL here won't be overwritten.
# We're open to ideas and will do our best to help with any problem. Contact us
# at www.xvarnish.com or [email protected]
When I receive confirmation from the dev's I will update this thread.
Hope that helps you and anyone else that is looking into Cachewall a.k.a. xVarnish.
Kindly,
W.