yum install varnish -y # or dnf install varnish -y
Version
1 2 3 4
varnishd -V varnishd (varnish-6.0.2 revision 0458b54db26cfbea79af45ca5c4767c7c2925a91) Copyright (c) 2006 Verdens Gang AS Copyright (c) 2006-2018 Varnish Software AS
cat /etc/varnish/default.vcl # # This is an example VCL file for Varnish. # # It does not do anything by default, delegating control to the #builtin VCL. The builtin VCL is called when there is no explicit #return statement. # # See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/ # and https://www.varnish-cache.org/trac/wiki/VCLExamples for more examples.
# Marker to tell the VCL compiler that this VCL has been adapted to the # new 4.0 format. vcl 4.0;
# Default backend definition. Set this to point to your content server. backend default { .host = "127.0.0.1"; .port = "8080"; }
sub vcl_recv { # Happens before we check if we have this in cache already. # # Typically you clean up the request here, removing cookies you don't need, # rewriting the request, etc. }
sub vcl_backend_response { # Happens after we have read the response headers from the backend. # # Here you clean the response headers, removing silly Set-Cookie headers # and other mistakes your backend does. }
sub vcl_deliver { # Happens when we have all the pieces we need, and are about to send the # response to the client. # # You can do accounting or modifying the final object here. }
安装 Hitch 1.5(EPEL)
hitch requires:
1 2
libev >= 4 openssl (recent, >=1.0.0 recommended)
hitch currently works on Linux, OpenBSD, FreeBSD, and MacOSX. It has been tested the most heavily on Linux/x86_64.
Enable/Disable various minor features. none Disable all features.
Use +/- prefix to enable/disable individual feature: short_panic Short panic message. wait_silo Wait for persistent silo. no_coredump No coredumps. esi_ignore_https Treat HTTPS as HTTP in ESI:includes esi_disable_xml_check Don't check of body looks like XML esi_ignore_other_elements Ignore non-esi XML-elements esi_remove_bom Remove UTF-8 BOM https_scheme Also split https URIs http2 Support HTTP/2 protocol http_date_postel Relax parsing of timestamps in HTTP headers