Found this: tyk/mw_context_vars.go at 28757d933269739d78a7ecee1c6dfa831afb386b · TykTechnologies/tyk · GitHub
Tried out of curiosity: $tyk_context.headers_Content_type
Got:
2018-01-26T23:04:26.784510257Z time="Jan 26 23:04:26" level=error msg="http: proxy error: dial tcp: address $tyk_context.headers_Content_type]:443: unexpected ']'
So I next tried out of curiosity: (casing diff)
$tyk_context.headers_Content_Type
I get:
2018-01-26T23:02:47.460678942Z 2018/01/26 23:02:47 http: panic serving 172.20.0.1:33614: runtime error: invalid memory address or nil pointer dereference
2018-01-26T23:02:47.460724138Z goroutine 667 [running]:
2018-01-26T23:02:47.460741656Z net/http.(*conn).serve.func1(0xc4205086e0)
2018-01-26T23:02:47.460747456Z /usr/local/go/src/net/http/server.go:1697 +0xd0
2018-01-26T23:02:47.460752813Z panic(0xd3f5c0, 0x151a200)
2018-01-26T23:02:47.460757490Z /usr/local/go/src/runtime/panic.go:491 +0x283
2018-01-26T23:02:47.460772075Z main.(*URLRewriteMiddleware).CheckHostRewrite(0xc420813500, 0xc4204361c0, 0x19, 0xc4204cac30, 0x29, 0xc420199200)
2018-01-26T23:02:47.460778496Z /src/github.com/TykTechnologies/tyk/mw_url_rewrite.go:285 +0x6d
2018-01-26T23:02:47.460783990Z main.(*URLRewriteMiddleware).ProcessRequest(0xc420813500, 0x145eb40, 0xc420371260, 0xc420199200, 0x0, 0x0, 0x1d, 0x412506, 0xc4209be910)
2018-01-26T23:02:47.460805142Z /src/github.com/TykTechnologies/tyk/mw_url_rewrite.go:308 +0x24d
2018-01-26T23:02:47.460810768Z main.createMiddleware.func1.1(0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460815160Z /src/github.com/TykTechnologies/tyk/middleware.go:81 +0x5a3
2018-01-26T23:02:47.460819463Z net/http.HandlerFunc.ServeHTTP(0xc420982e00, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460855490Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-01-26T23:02:47.460862281Z main.createMiddleware.func1.1(0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460866671Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-01-26T23:02:47.460870932Z net/http.HandlerFunc.ServeHTTP(0xc420982e40, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460875209Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-01-26T23:02:47.460879435Z main.createMiddleware.func1.1(0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460883571Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-01-26T23:02:47.460887858Z net/http.HandlerFunc.ServeHTTP(0xc420982e80, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460892177Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-01-26T23:02:47.460903437Z main.createMiddleware.func1.1(0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460907983Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-01-26T23:02:47.460912351Z net/http.HandlerFunc.ServeHTTP(0xc420982ec0, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460916777Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-01-26T23:02:47.460921137Z main.createMiddleware.func1.1(0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460925336Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-01-26T23:02:47.460929738Z net/http.HandlerFunc.ServeHTTP(0xc420982f00, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460934011Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-01-26T23:02:47.460940636Z main.createMiddleware.func1.1(0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460945210Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-01-26T23:02:47.460949550Z net/http.HandlerFunc.ServeHTTP(0xc420982f40, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460953907Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-01-26T23:02:47.460958110Z main.createMiddleware.func1.1(0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460962470Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-01-26T23:02:47.460966823Z net/http.HandlerFunc.ServeHTTP(0xc420982f80, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460971132Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-01-26T23:02:47.460982638Z main.createMiddleware.func1.1(0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460987290Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-01-26T23:02:47.460991635Z net/http.HandlerFunc.ServeHTTP(0xc420982fc0, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.460995890Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-01-26T23:02:47.461000135Z main.createMiddleware.func1.1(0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.461004357Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-01-26T23:02:47.461008644Z net/http.HandlerFunc.ServeHTTP(0xc420983000, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.461013889Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-01-26T23:02:47.461018089Z main.createMiddleware.func1.1(0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.461022256Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-01-26T23:02:47.461026540Z net/http.HandlerFunc.ServeHTTP(0xc420983040, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.461030872Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-01-26T23:02:47.461041053Z main.createMiddleware.func1.1(0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.461046195Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-01-26T23:02:47.461050454Z net/http.HandlerFunc.ServeHTTP(0xc420983080, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.461054758Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-01-26T23:02:47.461058865Z main.createMiddleware.func1.1(0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.461063069Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-01-26T23:02:47.461067878Z net/http.HandlerFunc.ServeHTTP(0xc4209830c0, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.461072467Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-01-26T23:02:47.461076845Z github.com/TykTechnologies/tyk/vendor/github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201da360, 0x145eb40, 0xc420371260, 0xc420199200)
2018-01-26T23:02:47.461081462Z /src/github.com/TykTechnologies/tyk/vendor/github.com/gorilla/mux/mux.go:150 +0xed
2018-01-26T23:02:47.461086820Z main.mainHandler.ServeHTTP(0x145eb40, 0xc420371260, 0xc420199000)
2018-01-26T23:02:47.461091173Z /src/github.com/TykTechnologies/tyk/main.go:1299 +0x73
2018-01-26T23:02:47.461095495Z main.(*mainHandler).ServeHTTP(0x15657c8, 0x145eb40, 0xc420371260, 0xc420199000)
2018-01-26T23:02:47.461099733Z <autogenerated>:1 +0x52
2018-01-26T23:02:47.461104056Z net/http.serverHandler.ServeHTTP(0xc4201652b0, 0x145eb40, 0xc420371260, 0xc420199000)
2018-01-26T23:02:47.461161572Z /usr/local/go/src/net/http/server.go:2619 +0xb4
2018-01-26T23:02:47.461167655Z net/http.(*conn).serve(0xc4205086e0, 0x145fb40, 0xc420924240)
2018-01-26T23:02:47.461172248Z /usr/local/go/src/net/http/server.go:1801 +0x71d
2018-01-26T23:02:47.461188987Z created by net/http.(*Server).Serve
2018-01-26T23:02:47.461194335Z /usr/local/go/src/net/http/server.go:2720 +0x288