Skip to content

Instantly share code, notes, and snippets.

Avatar

section-io-gists

View GitHub Profile
View templarbit-agent.json
{
"property-id": "<insert perperty ID>",
"secret-key": "<insert secret key>",
"monitor-only": true
}
View shieldsquare.json
{
"key":"<ShieldsquareAPIKey>",
"enabled":true,
"deployment_number":"<IntegrationDeploymentNumber>",
"support_email":"<YourSupportEmail>"
}
@section-io-gists
section-io-gists / kraken.json
Created May 21, 2019
Kraken Module configuration in Section
View kraken.json
{
"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>",
View waiting-room.html
<html><head></head><body><div style='margin: auto; width: 100%;'><h1>This site is busy, you are in a queue</div></body></html>
View vwr.json
{
"api_key": "YourGoSquaredAPIKeyNeedsToGoHere",
"threshold": 3000,
"enabled": false,
"section_visitors_version": "1",
"hostname": "YourHostNameNeedsToGoHere"
}
@section-io-gists
section-io-gists / Log Streaming with LUA
Created Nov 5, 2018
Stream logs in an HTTP format from section.io platform (Use cases - External log storage, Machine learning, data processing etc)
View Log Streaming with LUA
--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;
View server-stale-while-revalidate.vcl
# 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);
}
View 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 Dec 15, 2017
Increase browser cache TTL in Varnish VCL 4.0
View Static_browser_cache.vcl
# 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 Dec 14, 2017
Redirect traffic based on GEO IP lookup with whitelist (Varnish 4)
View GEOIPRedirection_whitelist.vcl
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;
}
You can’t perform that action at this time.