tyk 1.5/2.5, tyk docker quickstart setup
Docs --> https://tyk.io/docs/transfo…rm-traffic/url-rewriting/ states
```
This can also include a new hostname, but you must specify the transport, e.g.
https://my-new-target-host.com/my/service?value1=match&value2=me
```
Note my api def's target url is set to `https://myhost:8888/`
In middleware I set a header like
`X-My-Proxytourl=https://myhost:8888/some/path`
Rewrite config:
```
"url_rewrites": [
{
"path": "/.*",
"method": "POST",
"match_pattern": "/.*",
"rewrite_to": "$tyk_context.headers_X_My_Proxytourl",
"triggers": []
}
],
```
The tyk proxy returns a 400 "bad request" (https://myhost:8888/some/path is never hit)
Next if I try `X-My-Proxytourl=myhost:8888/some/path` and adjust rewrite config to:
```
"url_rewrites": [
{
"path": "/.*",
"method": "POST",
"match_pattern": "/.*",
"rewrite_to": "https://$tyk_context.headers_X_My_Proxytourl",
"triggers": []
}
],
```
I get this panic
```
2018-02-02T14:23:00.054825659Z 2018/02/02 14:23:00 http: panic serving 172.20.0.1:34758: runtime error: invalid memory address or nil pointer dereference
2018-02-02T14:23:00.054886028Z goroutine 16183 [running]:
2018-02-02T14:23:00.054928507Z net/http.(*conn).serve.func1(0xc42098e000)
2018-02-02T14:23:00.054942600Z /usr/local/go/src/net/http/server.go:1697 +0xd0
2018-02-02T14:23:00.054956093Z panic(0xd3f5c0, 0x151a200)
2018-02-02T14:23:00.054968587Z /usr/local/go/src/runtime/panic.go:491 +0x283
2018-02-02T14:23:00.054980881Z main.(*URLRewriteMiddleware).CheckHostRewrite(0xc421059ba0, 0xc42031cf20, 0x1a, 0xc4203b3600, 0x35, 0xc42018a900)
2018-02-02T14:23:00.054993575Z /src/github.com/TykTechnologies/tyk/mw_url_rewrite.go:285 +0x6d
2018-02-02T14:23:00.055006668Z main.(*URLRewriteMiddleware).ProcessRequest(0xc421059ba0, 0x145eb40, 0xc4203ff500, 0xc42018a900, 0x0, 0x0, 0x1d, 0x4122e7, 0xc421720778)
2018-02-02T14:23:00.055034454Z /src/github.com/TykTechnologies/tyk/mw_url_rewrite.go:308 +0x24d
2018-02-02T14:23:00.055049747Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055063640Z /src/github.com/TykTechnologies/tyk/middleware.go:81 +0x5a3
2018-02-02T14:23:00.055078232Z net/http.HandlerFunc.ServeHTTP(0xc420fa45c0, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055091925Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055105818Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055120811Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-02-02T14:23:00.055135004Z net/http.HandlerFunc.ServeHTTP(0xc420fa4600, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055147598Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055160391Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055172785Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-02-02T14:23:00.055185179Z net/http.HandlerFunc.ServeHTTP(0xc420fa4640, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055197673Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055214564Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055225659Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-02-02T14:23:00.055238952Z net/http.HandlerFunc.ServeHTTP(0xc420fa4680, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055251346Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055260641Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055273435Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-02-02T14:23:00.055286228Z net/http.HandlerFunc.ServeHTTP(0xc420fa46c0, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055381980Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055395474Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055404869Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-02-02T14:23:00.055413864Z net/http.HandlerFunc.ServeHTTP(0xc420fa4700, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055422660Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055431755Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055440351Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-02-02T14:23:00.055449147Z net/http.HandlerFunc.ServeHTTP(0xc420fa4740, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055457842Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055466438Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055488927Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-02-02T14:23:00.055498422Z net/http.HandlerFunc.ServeHTTP(0xc420fa4780, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055507218Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055515813Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055524409Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-02-02T14:23:00.055533005Z net/http.HandlerFunc.ServeHTTP(0xc420fa47c0, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055541600Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055550596Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055559192Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-02-02T14:23:00.055567887Z net/http.HandlerFunc.ServeHTTP(0xc420fa4800, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055576483Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055585079Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055594274Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-02-02T14:23:00.055602870Z net/http.HandlerFunc.ServeHTTP(0xc420fa4840, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055611466Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055620061Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055664139Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-02-02T14:23:00.055702220Z net/http.HandlerFunc.ServeHTTP(0xc420fa4880, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055716113Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055728807Z main.createMiddleware.func1.1(0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055738202Z /src/github.com/TykTechnologies/tyk/middleware.go:95 +0x76d
2018-02-02T14:23:00.055746998Z net/http.HandlerFunc.ServeHTTP(0xc420fa48c0, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055757792Z /usr/local/go/src/net/http/server.go:1918 +0x44
2018-02-02T14:23:00.055766688Z github.com/TykTechnologies/tyk/vendor/github.com/gorilla/mux.(*Router).ServeHTTP(0xc4214c1380, 0x145eb40, 0xc4203ff500, 0xc42018a900)
2018-02-02T14:23:00.055775384Z /src/github.com/TykTechnologies/tyk/vendor/github.com/gorilla/mux/mux.go:150 +0xed
2018-02-02T14:23:00.055783979Z main.mainHandler.ServeHTTP(0x145eb40, 0xc4203ff500, 0xc42018a700)
2018-02-02T14:23:00.055792675Z /src/github.com/TykTechnologies/tyk/main.go:1299 +0x73
2018-02-02T14:23:00.055817662Z main.(*mainHandler).ServeHTTP(0x15657c8, 0x145eb40, 0xc4203ff500, 0xc42018a700)
2018-02-02T14:23:00.055842250Z <autogenerated>:1 +0x52
2018-02-02T14:23:00.055860741Z net/http.serverHandler.ServeHTTP(0xc4201569c0, 0x145eb40, 0xc4203ff500, 0xc42018a700)
2018-02-02T14:23:00.055870436Z /usr/local/go/src/net/http/server.go:2619 +0xb4
2018-02-02T14:23:00.055879232Z net/http.(*conn).serve(0xc42098e000, 0x145fb40, 0xc420b086c0)
2018-02-02T14:23:00.055887727Z /usr/local/go/src/net/http/server.go:1801 +0x71d
2018-02-02T14:23:00.055896223Z created by net/http.(*Server).Serve
2018-02-02T14:23:00.055904719Z /usr/local/go/src/net/http/server.go:2720 +0x288
```
Other than these logs, I have no visibility into what proxy to uri that tyk is actually sending the request to.