Skip to content

Instantly share code, notes, and snippets.

View colinjlacy's full-sized avatar

Colin J Lacy colinjlacy

  • Cisco
  • Albany, NY
View GitHub Profile
@colinjlacy
colinjlacy / envoy-filter.yaml
Created November 23, 2023 14:29
An example EnvoyFilter that turns a user-facing 403 into a 302 redirect, which, in my use case, sent them to a form where they could request access.
# Source: istio-gateway/templates/envoy-filter.yaml
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: modify-403-to-302
# replace with the namespace you'd like to target
namespace: <target-namespace>
spec:
configPatches:
- applyTo: HTTP_FILTER
{
"log": ["CRUD", "CRUD+", "HTTP", "HTTP+", "Access", "Cache", "Changes", "Changes+", "WS"],
"interface":":5984",
"adminInterface":":5985",
"compressResponses": false,
"databases":{
"default":{
"server":"http://192.168.99.100:8091",
"bucket":"default",
"sync": ` function(doc, oldDoc) { channel("all_docs"); } `,