메시지 프로세서에서 405 속성에 대한 무시 허용 헤더 구성

현재 Apigee Edge 문서가 표시되고 있습니다.
Apigee X 문서로 이동
정보

클라이언트-서버 통신에서 클라이언트가 제공한 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. 게이트웨이 허용 없음에 설명된 대로 Allow 헤더를 포함한 HTTP 상태 코드 405 Method Not Allowed로 응답하는 것입니다.

하지만 예외적인 경우 백엔드를 수정하거나 이 문제를 즉시 해결하도록 API 프록시를 수정하지 못할 수 있습니다.

이 경우 일시적으로 메시지 프로세서 수준에서 405 속성 HTTP.ignore.allow_header.for.405에 허용 무시 헤더를 설정할 수 있습니다. 이 속성을 true로 설정하면 백엔드 서버가 Allow 헤더 없이 HTTP 상태 코드 405 Method Not Allowed를 전송하더라도 Apigee가 클라이언트 애플리케이션에 502 Bad Gateway 응답을 반환하지 않습니다.

Allow 헤더와 함께 HTTP 상태 코드 405 Method Not Allowed를 전송하도록 백엔드 서버를 수정할 수 있는 상태가 되면 HTTP.ignore.allow_header.for.405 속성을 기본값 false로 되돌릴 수 있습니다.

시작하기 전에

이 문서의 단계를 수행하기 전에 다음 주제를 이해해야 합니다.

메시지 프로세서에서 405 속성의 무시 허용 헤더를 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로 구성하는 방법을 설명합니다.

  1. 메시지 프로세서 머신에서 편집기에서 다음 파일을 엽니다. 아직 없으면 새로 만듭니다.

    /opt/apigee/customer/application/message-processor.properties
    

    예를 들어 vi를 사용하여 파일을 열려면 다음을 입력합니다.

    vi /opt/apigee/customer/application/message-processor.properties
    
  2. 다음 형식의 행을 속성 파일에 추가합니다.
    conf_http_HTTP.ignore.allow_header.for.405=true
    
  3. 변경사항을 저장합니다.
  4. 아래와 같이 속성 파일을 apigee 사용자가 소유하고 있는지 확인합니다.
    chown apigee:apigee /opt/apigee/customer/application/message-processor.properties
    
  5. 아래와 같이 메시지 프로세서를 다시 시작합니다.
    /opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart
    
  6. 메시지 프로세서가 두 개 이상 있으면 모든 메시지 프로세서에서 위 단계를 반복합니다.

메시지 프로세서에서 405 속성의 허용 헤더 무시가 true로 설정되어 있는지 확인

이 섹션에서는 메시지 프로세서에서 HTTP.ignore.allow_header.for.405 속성이 true로 성공적으로 업데이트되었는지 확인하는 방법을 설명합니다.

conf_http_HTTP.ignore.allow_header.for.405 토큰을 사용하여 메시지 프로세서의 속성 값을 업데이트하더라도 실제 속성 HTTP.ignore.allow_header.for.405true로 설정되었는지 확인해야 합니다.

  1. 메시지 프로세서 시스템의 /opt/apigee/edge-message-processor/conf 디렉터리에서 HTTP.ignore.allow_header.for.405 속성을 검색하여 아래와 같이 true로 설정되어 있는지 확인합니다.
    grep -ri "HTTP.ignore.allow_header.for.405" /opt/apigee/edge-message-processor/conf
    
  2. 속성이 메시지 프로세서에서 성공적으로 업데이트되면 위 명령어는 아래 표시된 것처럼 http.properties 파일에 속성 HTTP.ignore.allow_header.for.405의 값을 true로 표시해야 합니다.
    /opt/apigee/edge-message-processor/conf/http.properties:HTTP.ignore.allow_header.for.405=true
    
  3. 여전히 HTTP.ignore.allow_header.for.405 속성 값이 false로 표시되면 메시지 프로세서에서 405 속성의 무시 허용 헤더를 true로 구성하는 데 설명된 모든 단계를 올바르게 수행했는지 확인합니다. 누락된 단계가 있으면 모든 단계를 다시 올바르게 반복합니다.
  4. 여전히 HTTP.ignore.allow_header.for.405 속성을 수정할 수 없으면 Apigee Edge 지원팀에 문의하세요.

메시지 프로세서에서 405 속성의 무시 허용 헤더를 false로 구성

이 섹션에서는 Edge 구성 방법에 설명된 구문에 따라 토큰을 사용하여 메시지 프로세서에서 HTTP.ignore.allow_header.for.405 속성을 기본값인 false 로 구성하는 방법을 설명합니다.

  1. HTTP.ignore.allow_header.for.405 속성이 true로 수정되었는지 확인합니다. /opt/apigee/edge-message-processor/conf 디렉터리에서 이 속성을 검색하고 다음 명령어를 사용하여 값을 확인하면 됩니다.
    grep -ri "HTTP.ignore.allow_header.for.405" /opt/apigee/edge-message-processor/conf
    
  2. 이 속성이 메시지 프로세서에서 true로 설정된 경우 위 명령어는 아래와 같이 HTTP.ignore.allow_header.for.405 속성의 값을 http.properties 파일의 true로 표시해야 합니다.
    /opt/apigee/edge-message-processor/conf/http.properties:HTTP.ignore.allow_header.for.405=true
    
  3. 위의 명령어에 HTTP.ignore.allow_header.for.405 속성이 false (기본값)로 설정되어 있으면 다른 작업이 필요하지 않습니다. 즉, 다음 단계를 건너뜁니다.
  4. 속성 HTTP.ignore.allow_header.for.405true로 설정된 경우 다음 단계를 수행하여 기본값 false로 되돌립니다.
  5. 메시지 프로세서 머신에서 편집기에서 다음 파일을 엽니다.

    /opt/apigee/customer/application/message-processor.properties
    

    예를 들어 vi를 사용하여 파일을 열려면 다음을 입력합니다.

    vi /opt/apigee/customer/application/message-processor.properties
    
  6. 속성 파일에서 다음 줄을 삭제합니다.
    conf_http_HTTP.ignore.allow_header.for.405=true
    
  7. 변경사항을 저장합니다.
  8. 아래와 같이 속성 파일을 apigee 사용자가 소유하고 있는지 확인합니다.
    chown apigee:apigee /opt/apigee/customer/application/message-processor.properties
    
  9. 아래와 같이 메시지 프로세서를 다시 시작합니다.
    /opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart
    
  10. 메시지 프로세서가 두 개 이상 있으면 모든 메시지 프로세서에서 위 단계를 반복합니다.

메시지 프로세서에서 405 속성의 허용 헤더 무시가 false로 설정되어 있는지 확인

이 섹션에서는 메시지 프로세서에서 HTTP.ignore.allow_header.for.405 속성이 false로 성공적으로 업데이트되었는지 확인하는 방법을 설명합니다.

conf_http_HTTP.ignore.allow_header.for.405 토큰을 사용하여 메시지 프로세서의 값을 업데이트하더라도 실제 속성 HTTP.ignore.allow_header.for.405false로 설정되었는지 확인해야 합니다.

  1. 메시지 프로세서 시스템의 /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
    
  2. 속성이 메시지 프로세서에서 성공적으로 업데이트되면 위 명령어는 아래 표시된 것처럼 http.properties 파일에 속성 HTTP.ignore.allow_header.for.405의 값을 false로 표시해야 합니다.
    /opt/apigee/edge-message-processor/conf/http.properties:HTTP.ignore.allow_header.for.405=false
    
  3. 여전히 HTTP.ignore.allow_header.for.405 속성 값이 true로 표시되면 메시지 프로세서에서 405 속성의 무시 허용 헤더를 false로 구성에 설명된 모든 단계를 올바르게 수행했는지 확인합니다. 누락된 단계가 있으면 모든 단계를 다시 올바르게 반복합니다.
  4. 여전히 HTTP.ignore.allow_header.for.405 속성을 수정할 수 없으면 Apigee Edge 지원팀에 문의하세요.