Skip to content

Instantly share code, notes, and snippets.

{
"property-id": "<insert perperty ID>",
"secret-key": "<insert secret key>",
"monitor-only": true
}
{
"key":"<ShieldsquareAPIKey>",
"enabled":true,
"deployment_number":"<IntegrationDeploymentNumber>",
"support_email":"<YourSupportEmail>"
}
@section-io-gists
section-io-gists / kraken.json
Created May 21, 2019 05:01
Kraken Module configuration in Section
{
"api_key": "<Kraken API Key>",
"api_key_secret": "<Kraken API Secret",
"cache_version": "v1",
"lossy": true,
"enabled": true,
"ttl": 604800,
"s3": {
"key": "<S3 Bucket Key>",
"secret": "<S3 Bucket Secret>",
<html><head></head><body><div style='margin: auto; width: 100%;'><h1>This site is busy, you are in a queue</div></body></html>
{
"api_key": "YourGoSquaredAPIKeyNeedsToGoHere",
"threshold": 3000,
"enabled": false,
"section_visitors_version": "1",
"hostname": "YourHostNameNeedsToGoHere"
}
@section-io-gists
section-io-gists / Log Streaming with LUA
Created November 5, 2018 04:13
Stream logs in an HTTP format from section.io platform (Use cases - External log storage, Machine learning, data processing etc)
--Requires section.io OpenResty module
--Requires an "Alternate Origin" configured that points to an HTTP log ingestion endpoint: https://www.section.io/docs/how-to/multiple-origins/
--There are several files that need to be created in the "openresty" folder in the section.io configuration. Recommend cloning the git repository from "Advanced Config" menu in section.io portal.
--server.conf should contain:
location / {
#https://github.com/openresty/lua-nginx-module#log_by_lua_file
log_by_lua_file /opt/proxy_config/log.lua;
# You must set a grace period on any object you put in cache for this to work.
sub vcl_hit {
if (obj.ttl >= 0s) {
return (deliver);
}
if (obj.ttl + obj.grace > 0s) {
return (deliver);
}
@section-io-gists
section-io-gists / basicAuthVCL4.vcl
Last active June 2, 2020 01:50
basicAuthVCL4.vcl
sub vcl_recv {
if (! req.http.Authorization ~ "Basic dXNlcm5hbWU6cGFzc3dvcmQ=") {
# This is checking for base64 encoded username:password combination
return(synth(401, "Authentication required"));
}
unset req.http.Authorization;
}
@section-io-gists
section-io-gists / Static_browser_cache.vcl
Created December 15, 2017 04:59
Increase browser cache TTL in Varnish VCL 4.0
# Cache statics
if ((bereq.url ~ "\.(css)(?=\?|&|$)" && beresp.http.Content-Type ~ "text/css")
|| (bereq.url ~ "\.(jpe?g|png|gif|ico)(?=\?|&|$)" && beresp.http.Content-Type ~ "image/")
|| (bereq.url ~ "\.(js)(?=\?|&|$)" && beresp.http.Content-Type ~ "javascript")
|| (bereq.url ~ "\.(swf)(?=\?|&|$)" && beresp.http.Content-Type ~ "application/x-shockwave-flash")
|| (bereq.url ~ "\.(woff)(?=\?|&|$)" && beresp.http.Content-Type ~ "font")) {
set beresp.http.Cache-Control = "public, max-age=604800"
}
@section-io-gists
section-io-gists / GEOIPRedirection_whitelist.vcl
Created December 14, 2017 22:25
Redirect traffic based on GEO IP lookup with whitelist (Varnish 4)
acl whitelist_geo {
"13.13.22.30";
"123.39.96.0"/24;
}
acl geo_to_au {
"1.1.22.30";
"133.29.93.0"/30;
}