Apigee Edge 문서입니다.
Go to the
Apigee X 문서로 이동합니다. info
클라이언트-서버 통신에서 서버는 클라이언트가 제공한
HTTP 요청 메서드가 서버에 알려져 있지만 대상 리소스에서 지원되지 않는 경우 HTTP 상태 코드 405
Method Not Allowed로 응답합니다. 마찬가지로 Apigee Edge에서 백엔드 서버는
HTTP 상태 코드 405 Method Not Allowed.로 응답할 수 있습니다.
Apigee Edge는 백엔드 서버가 사양
RFC 7231, 섹션 6.5.5: 405 메서드 허용되지 않음에 따라 Allow 헤더에 허용된 메서드 목록과 함께 405 Method Not Allowed 응답을 전송할 것으로 예상합니다.
Allow 헤더는 다음 형식으로 전송되어야 합니다.
Allow: HTTP_METHODS
예를 들어 백엔드 서버에서 GET, POST 및
HEAD 메서드를 허용하는 경우 Allow 헤더에 다음과 같이 포함되어 있는지 확인해야 합니다.
Allow: GET, POST, HEAD
백엔드 서버가 HTTP 상태 코드
405 Method Not Allowed,와 함께 Allow 헤더를 전송하지 않으면 Apigee는 오류 코드 protocol.http.Response405WithoutAllowHeader 와 함께 HTTP 상태 코드 502 Bad
Gateway를 클라이언트 애플리케이션에 반환합니다. 이 오류를 해결하기 위한 권장되는 해결 방법은 백엔드 서버를 수정하여 사양
RFC 7231, 섹션 6.5.5: 405 메서드 허용되지 않음을 준수하거나 오류 처리 기능을 사용하여
문제 해결 플레이북
502 Bad Gateway - Allow 헤더가 없는 응답 405에 설명된 대로
Allow 헤더를 포함한 HTTP 상태 코드 405 Method Not Allowed로 응답하는 것입니다.
하지만 예외적인 경우 백엔드를 수정하거나 API 프록시를 수정하여 이 문제를 즉시 해결하지 못할 수도 있습니다.
이 경우 메시지 프로세서 수준에서 405 속성
HTTP.ignore.allow_header.for.405에 대해 Allow 헤더 무시를 일시적으로 설정할 수 있습니다. 이 속성을 true로 설정하면 백엔드 서버가 Allow 헤더 없이 HTTP 상태 코드 405 Method Not Allowed를 전송하더라도 Apigee
가 클라이언트 애플리케이션에 502 Bad Gateway 응답을 반환하지 않습니다.
백엔드 서버를 수정하여 HTTP 상태 코드 405 Method
Not Allowed를 Allow 헤더와 함께 전송할 수 있게 되면 속성
HTTP.ignore.allow_header.for.405를 기본값 false로 되돌릴 수 있습니다.
시작하기 전에
이 문서의 단계를 사용하기 전에 다음 주제를 이해해야 합니다.
- 플레이북 - 502 Bad Gateway - Allow 헤더가 없는 응답 405를 읽어보세요.
- Private Cloud용 Edge의 속성 구성에 익숙하지 않은 경우 Edge 구성 방법을 읽어보세요.
메시지 프로세서에서 405 속성에 대해 Allow 헤더 무시를 true로 구성
Apigee Edge에서 속성 HTTP.ignore.allow_header.for.405는 기본적으로
false로 설정됩니다. 이렇게 하면 백엔드 서버가 Allow 헤더 없이 HTTP 상태 코드 405 Method Not
Allowed를 전송하는 경우 Apigee Edge가 오류 코드 protocol.http.Response405WithoutAllowHeader와 함께 502 Bad
Gateway를
클라이언트 애플리케이션에 반환할 수 있습니다. Apigee Edge가 클라이언트 애플리케이션에 502 Bad Gateway를 전송하지 못하도록 하려면 메시지 프로세서에서 속성 HTTP.ignore.allow_header.for.405의 값을 true로 설정해야 합니다.
이 섹션에서는 Edge 구성 방법에 설명된 구문에 따라 토큰을 사용하여 메시지 프로세서에서 속성
HTTP.ignore.allow_header.for.405를 true로 구성하는 방법을 설명합니다.
-
메시지 프로세서 머신에서 편집기로 다음 파일을 엽니다. 파일이 아직 없는 경우 파일을 만듭니다.
/opt/apigee/customer/application/message-processor.properties
예를 들어 vi를 사용하여 파일을 열려면 다음을 입력합니다.
vi /opt/apigee/customer/application/message-processor.properties
- 다음 형식으로 속성 파일에 줄을 추가합니다.
conf_http_HTTP.ignore.allow_header.for.405=true
- 변경사항을 저장합니다.
- 아래와 같이 속성 파일이
apigee사용자가 소유하고 있는지 확인합니다.chown apigee:apigee /opt/apigee/customer/application/message-processor.properties
- 아래와 같이 메시지 프로세서를 다시 시작합니다.
/opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart
- 메시지 프로세서가 두 개 이상인 경우 모든 메시지 프로세서에서 위의 단계를 반복합니다.
메시지 프로세서에서 405 속성에 대해 Allow 헤더 무시가 true로 설정되었는지 확인
이 섹션에서는 메시지 프로세서에서 속성
HTTP.ignore.allow_header.for.405가 true
로 업데이트되었는지 확인하는 방법을 설명합니다.
메시지 프로세서에서 토큰 conf_http_HTTP.ignore.allow_header.for.405를 사용하여 메시지 프로세서의 속성 값을 업데이트하더라도 실제 속성
HTTP.ignore.allow_header.for.405가 true로 설정되었는지 확인해야 합니다.
- 메시지 프로세서 머신에서
HTTP.ignore.allow_header.for.405디렉터리에서 속성/opt/apigee/edge-message-processor/conf를 검색하고 아래와 같이true로 설정되었는지 확인합니다.grep -ri "HTTP.ignore.allow_header.for.405" /opt/apigee/edge-message-processor/conf
- 메시지 프로세서에서 속성이 업데이트되면 위의 명령어
는 속성
HTTP.ignore.allow_header.for.405의 값을true파일에서http.properties로 아래와 같이 표시해야 합니다./opt/apigee/edge-message-processor/conf/http.properties:HTTP.ignore.allow_header.for.405=true
- 속성
HTTP.ignore.allow_header.for.405의 값이false로 여전히 표시되면 메시지 프로세서에서 405 속성에 대해 Allow 헤더 무시를 true로 구성에 설명된 모든 단계를 올바르게 따랐는지 확인합니다. 단계를 누락한 경우 모든 단계를 다시 올바르게 반복합니다. - 여전히 속성
HTTP.ignore.allow_header.for.405를 수정할 수 없는 경우 Apigee Edge 지원팀에 문의하세요.
메시지 프로세서에서 405 속성에 대해 Allow 헤더 무시를 false로 구성
이 섹션에서는 Edge 구성 방법에 설명된 구문에 따라 토큰을 사용하여 메시지 프로세서에서 속성
HTTP.ignore.allow_header.for.405를 기본값 false
로 구성하는 방법을 설명합니다.
How to configure Edge.
- 속성
HTTP.ignore.allow_header.for.405가true로 수정되었는지 확인합니다. `/opt/apigee/edge-message-processor/conf`/opt/apigee/edge-message-processor/conf디렉터리에서 이 속성을 검색하고 다음 명령어를 사용하여 값을 확인하면 됩니다.grep -ri "HTTP.ignore.allow_header.for.405" /opt/apigee/edge-message-processor/conf
- 메시지 프로세서에서 속성이
true로 설정되면 위의 명령어 는 아래와 같이http.properties파일에서 속성HTTP.ignore.allow_header.for.405의 값을true로 표시해야 합니다./opt/apigee/edge-message-processor/conf/http.properties:HTTP.ignore.allow_header.for.405=true
- 위의 명령어에 속성
HTTP.ignore.allow_header.for.405가false(기본값)로 설정되어 있다고 표시되면 다른 작업을 할 필요가 없습니다. 즉, 다음 단계를 건너뜁니다. - 속성
HTTP.ignore.allow_header.for.405이true로 설정된 경우 다음 단계를 수행하여 기본값false로 되돌립니다. 메시지 프로세서 머신에서 편집기로 다음 파일을 엽니다.
/opt/apigee/customer/application/message-processor.properties
예를 들어 vi를 사용하여 파일을 열려면 다음을 입력합니다.
vi /opt/apigee/customer/application/message-processor.properties
- 속성 파일에서 다음 줄을 삭제합니다.
conf_http_HTTP.ignore.allow_header.for.405=true
- 변경사항을 저장합니다.
- 아래와 같이 속성 파일이
apigee사용자가 소유하고 있는지 확인합니다.chown apigee:apigee /opt/apigee/customer/application/message-processor.properties
- 아래와 같이 메시지 프로세서를 다시 시작합니다.
/opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart
- 메시지 프로세서가 두 개 이상인 경우 모든 메시지 프로세서에서 위의 단계를 반복합니다.
메시지 프로세서에서 405 속성에 대해 Allow 헤더 무시가 false로 설정되었는지 확인
이 섹션에서는 메시지 프로세서에서 속성
HTTP.ignore.allow_header.for.405가 false
로 업데이트되었는지 확인하는 방법을 설명합니다.
메시지 프로세서에서 토큰
conf_http_HTTP.ignore.allow_header.for.405를 사용하여 값을 업데이트하더라도 실제 속성 HTTP.ignore.allow_header.for.405
가 false로 설정되었는지 확인해야 합니다.
- 메시지 프로세서 머신에서
/opt/apigee/edge-message- processor/conf디렉터리에서 속성HTTP.ignore.allow_header.for.405를 검색하고 아래와 같이false로 설정되었는지 확인합니다.grep -ri "HTTP.ignore.allow_header.for.405" /opt/apigee/edge-message-processor/conf
- 메시지 프로세서에서 속성이 업데이트되면 위의 명령어
는 속성
HTTP.ignore.allow_header.for.405의 값을false로http.properties파일에 아래와 같이 표시해야 합니다./opt/apigee/edge-message-processor/conf/http.properties:HTTP.ignore.allow_header.for.405=false
- 속성
HTTP.ignore.allow_header.for.405의 값이true로 여전히 표시되면 메시지 프로세서에서 405 속성에 대해 Allow 헤더 무시를 false로 구성 에 설명된 모든 단계를 올바르게 따랐는지 확인합니다. 단계를 누락한 경우 모든 단계를 다시 올바르게 반복합니다. - 여전히 속성
HTTP.ignore.allow_header.for.405를 수정할 수 없는 경우 Apigee Edge 지원팀에 문의하세요.