I just tried this:
curl -i -X POST \
--url http://localhost:8001/services/ \
--data 'name=example-service' \
--data 'url=http://mockbin.org'
curl -i -X POST \
--url http://localhost:8001/services/example-service/routes \
--data 'hosts[]=example.com'
curl -i -X GET \
--url http://localhost:8000/ \
--header 'Host: example.com'
But it gives empty response from server.
curl: (52) Empty reply from server
Error logs (/usr/local/kong/logs/error.log) shows:
2019/05/10 09:24:36 [error] 1797#0: *69689 broken header: "GET / HTTP/1.1^M
User-Agent: curl/7.29.0^M
Accept: */*^M
Host: example.com^M
^M
" while reading PROXY protocol, client: 127.0.0.1, server: 0.0.0.0:8000
NOTE: curl localhost:8001 (kong admin api) is working fine.
Please help here what am I missing.
I just modified few things in kong.conf.
In proxy_admin added proxy_protocol.
And pointed to correct postgres instance.