App Service HTTP/2 설정 점검

클라이언트 호환성과 전송 요구에 맞춰 HTTP/2 사용을 검토하세요.

설명

한 연결에서 여러 요청을 동시에 처리하는 HTTP/2가 서비스에 필요하면 site_config.http2_enabled를 true로 설정하세요. HTTP/1.1과 HTTP/2 모두 HTTPS로 사용할 수 있습니다.

잠재적 영향

클라이언트가 HTTP/2를 사용해야 하는데 앱이 이를 제공하지 않으면 필요한 전송 기능이나 성능 기준을 충족하지 못할 수 있습니다.

해결 방법

실제 클라이언트로 HTTPS 요청을 보내 협상된 프로토콜이 HTTP/2인지 확인하세요. HTTPS 전용 설정, 최소 TLS 버전, 인증서와 사용자 인증은 별도로 확인하세요. 클라이언트 인증서를 쓴다면 HTTP/2가 지원하지 않는 TLS 재협상이 필요한 모드나 제외 경로를 피하세요.

예시

두 번째 AzureRM 3.x azurerm_app_service 예시는 HTTP/2를 켜고 최소 TLS 버전을 1.2로 지정합니다. 현재 Linux·Windows Web App 리소스도 HTTP/2를 지원합니다.

변경 전

hcl
resource "azurerm_app_service" "example" {
  name                = "example-app-service"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  app_service_plan_id = azurerm_app_service_plan.example.id

  app_settings = {
    "SOME_KEY" = "some-value"
  }
}

변경 후

hcl
resource "azurerm_app_service" "example" {
  name                = "example-app-service"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  app_service_plan_id = azurerm_app_service_plan.example.id

  app_settings = {
    "SOME_KEY" = "some-value"
  }

  site_config {
    dotnet_framework_version = "v4.0"
    scm_type                 = "LocalGit"
    min_tls_version          = 1.2
    http2_enabled            = true
  }
}

참조