This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Lets Encrypt certbot challenge VCL | |
| backend certbot { | |
| .host = "127.0.0.1"; | |
| .port = "888"; | |
| } | |
| sub vcl_recv { | |
| unset req.http.X-lets-certbot; | |
| if (req.url ~ "^/\.well-known/acme-challenge/" && !req.restarts) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| varnishtest "Test JSON forwarding (4.1)" | |
| server s1 { | |
| rxreq | |
| txresp -body { | |
| { | |
| "key":"respvalue", | |
| "key2":23, | |
| "2": { | |
| "nested":"goal" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| varnishtest "Test JSON response body parsing with nesting" | |
| server s1 { | |
| rxreq | |
| txresp -body { | |
| { | |
| "key":"value", | |
| "key2":23, | |
| "2": { | |
| "nested":"goal" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| varnishtest "Test JSON response body parsing" | |
| server s1 { | |
| rxreq | |
| txresp -body { | |
| { | |
| "key":"value", | |
| "key2":23 | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| varnishtest "Generate CSP nonces for Javascript" | |
| server s1 { | |
| rxreq | |
| txresp -hdr "Content-Type: text/html" -body { | |
| <html> | |
| <script> | |
| var a=1; | |
| </script> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # hit_miss.vcl for Varnish 6.0 | |
| vcl 4.0; | |
| # What are we, hit, miss, or pass? | |
| sub vcl_recv { | |
| set req.http.X-status = "NONE"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| varnishtest "Test using Varnish to aggregate headers and body" | |
| server s1 { | |
| rxreq | |
| expect req.url == "/1" | |
| txresp -nolen -hdr "Content-Length: 3" | |
| delay 3 | |
| send "abc" | |
| rxreq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vcl 4.0; | |
| # If you set req.http.X-aggregate = "true", Varnish will aggregate | |
| # the headers and response body into a single response block | |
| # Point this back to Varnish | |
| #backend loop { | |
| # .host = "127.0.0.1"; | |
| # .port = "80"; | |
| #} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Magento 1.x VCL configuration | |
| vcl 4.0; | |
| import cookieplus; | |
| import edgestash; | |
| import kvstore; | |
| import xbody; | |
| sub vcl_init |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vcl 4.0; | |
| import kvstore; | |
| # https://docs.varnish-software.com/varnish-cache-plus/vmods/kvstore-4/ | |
| sub vcl_init | |
| { | |
| kvstore.init(0, 25000); | |
| } |