REST 및 API 게이트웨이에 새로 추가되었습니다.Kong에 API 추가
저는 Cassandra를 사용하여 개발 컴퓨터에 Kong을 설치했으며 API (스프링 부팅 응용 프로그램)를 추가하려고했지만 문서를 읽으면 작동하도록 고심하고 있습니다.
내 API : 나는
http http://ff-nginxdev-01:9003/fund-information-services/first-information/fund/630
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8
Date: Fri, 25 Nov 2016 14:47:30 GMT
Transfer-Encoding: chunked
X-Application-Context: application:9003
{
"assetSplit": {
"allocationHistories": [
{
"key": {
"asset": {
"description": "Other Far East",
"id": 18
},
"assetSplit": "09",
"effectiveDate": 1430348400000
},
......
......
모두를 실행할 때
http://ff-nginxdev-01:9003/fund-information-services/first-information/fund/{fundId}
잘보고 내가 JSON 메시지를 검색 할 수 있어요. 홍콩의 API를 추가
:
http POST http://ff-nginxdev-01:8001/apis/ name=fund-information upstream_url=http://ff-nginxdev-01:9003/ request_path=/fund-information-services
HTTP/1.1 201 Created
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Type: application/json; charset=utf-8
Date: Fri, 25 Nov 2016 14:39:45 GMT
Server: kong/0.9.4
Transfer-Encoding: chunked
{
"created_at": 1480084785000,
"id": "fdcc76d7-e2a2-4816-8f27-d506fdd32c0a",
"name": "fund-information",
"preserve_host": false,
"request_path": "/fund-information-services",
"strip_request_path": false,
"upstream_url": "http://ff-nginxdev-01:9003/"
}
테스트 홍콩 API 게이트웨이 :
http http://ff-nginxdev-01:8000/fund-information-services/first-information/fund/630
HTTP/1.1 502 Bad Gateway
Connection: keep-alive
Content-Type: text/plain; charset=UTF-8
Date: Fri, 25 Nov 2016 14:44:33 GMT
Server: kong/0.9.4
Transfer-Encoding: chunked
An invalid response was received from the upstream server
내가 모르는 뭔가가있어 알고 있지만 그것은 나에게 명확하지 않다.
Nginx에 아마도'ff-nginxdev-01'을 해결할 수 없을 것입니다.그것을 해결할 수있는 리졸버 (Kong의 설정 파일을 통해 그렇게 할 수있는)를 사용하고 이상적으로는 FQDN을 사용하도록 Nginx를 적절히 구성해야합니다. – thibaultcha