Skip to main content

Using GitHub Enterprise Server with a load balancer

Use a load balancer in front of a single GitHub Enterprise Server instance or a pair of instances in a High Availability configuration.

About load balancers

부하 분산 장치 디자인은 네트워크 디바이스를 사용하여 Git 및 HTTP 트래픽을 개별 GitHub Enterprise Server 어플라이언스로 전달합니다. 부하 분산 장치를 사용하여 보안 목적으로 어플라이언스로 직접 트래픽을 제한하거나 DNS 레코드 변경 없이 필요한 경우 트래픽을 리디렉션할 수 있습니다. 프록시 프로토콜을 지원하는 TCP 기반 부하 분산 장치를 사용하는 것이 좋습니다.

GitHub Enterprise Server 호스트 이름에 대한 DNS 조회는 부하 분산 장치로 확인되어야 합니다. 하위 도메인 격리를 사용하도록 설정하는 것이 좋습니다. 하위 도메인 격리를 사용하도록 설정하면 추가 와일드카드 레코드(*.HOSTNAME)도 부하 분산 장치로 확인되어야 합니다. 자세한 내용은 "Enabling subdomain isolation"을(를) 참조하세요.

Handling client connection information

Because client connections to GitHub Enterprise Server come from the load balancer, the client IP address can be lost.

부하 분산 장치가 지원할 수 있는 경우 PROXY 프로토콜을 구현하는 것이 좋습니다. 프록시 지원을 사용할 수 없는 경우 X-Forwarded-For 헤더를 사용하여 HTTP 및 HTTPS 포트의 부하를 분산할 수도 있습니다.

보안 경고: 프록시 지원 또는 HTTP 전달을 사용하는 경우 외부 트래픽이 GitHub Enterprise Server 어플라이언스에 직접 연결할 수 없는 것이 중요합니다. 외부 트래픽이 제대로 차단되지 않으면 원본 IP 주소가 위조될 수 있습니다.

경고: 부하 분산 장치에서 HTTPS 연결을 종료할 때 부하 분산 장치에서 GitHub Enterprise Server로의 요청도 HTTPS를 사용해야 합니다. HTTP에 대한 연결을 다운그레이드하는 것은 지원되지 않습니다.

Enabling PROXY protocol support on GitHub Enterprise Server 인스턴스

We strongly recommend enabling PROXY protocol support for both your instance and the load balancer. Use the instructions provided by your vendor to enable the PROXY protocol on your load balancer. For more information, see the PROXY protocol documentation.

참고: GitHub Enterprise Server는 AWS Network Load Balancer와 호환되지 않는 PROXY 프로토콜 V1을 지원합니다. GitHub Enterprise Server에서 AWS Network Load Balancer를 사용하는 경우 PROXY 지원을 사용하지 마세요.

  1. 페이지의 오른쪽 상단에 있는 GitHub Enterprise Server의 관리 계정에서 을 클릭합니다.

  2. “Site admin”(사이트 관리자) 페이지에 아직 없는 경우 왼쪽 상단에서 Site admin(사이트 관리자)을 클릭합니다.

  3. " 사이트 관리자" 사이드바에서 관리 콘솔 을 클릭합니다.

  4. 설정에서 사이드바의 프라이버시 탭을 클릭하세요.

  5. Under "External load balancers", select Enable support for PROXY protocol.

  6. "설정" 사이드바에서 설정 저장을 클릭합니다.

    참고: 관리 콘솔에 설정을 저장하면 시스템 서비스가 다시 시작되어 사용자에게 표시되는 가동 중지 시간이 발생할 수 있습니다.

  7. 구성 실행이 완료될 때까지 기다립니다.

PROXY 프로토콜 TCP 포트 매핑

원본 포트대상 포트서비스 설명
2223SSH를 통한 Git
8081HTTP
443444HTTPS
80808081관리 콘솔 HTTP
84438444관리 콘솔 HTTPS
94189419Git

Enabling X-Forwarded-For support on GitHub Enterprise Server 인스턴스

PROXY 프로토콜을 사용할 수 없는 경우에만 X-Forwarded-For 프로토콜을 사용합니다. X-Forwarded-For 헤더는 HTTP 및 HTTPS에서만 작동합니다. SSH를 통한 Git 연결에 대해 보고된 IP 주소는 부하 분산 장치 IP를 표시합니다.

Warning: If you configure X-Forwarded-For support on GitHub Enterprise Server 인스턴스 and load balancer, you may not be able to connect to the 관리 콘솔. For more information, see "Using GitHub Enterprise Server with a load balancer."

  1. 페이지의 오른쪽 상단에 있는 GitHub Enterprise Server의 관리 계정에서 을 클릭합니다.

  2. “Site admin”(사이트 관리자) 페이지에 아직 없는 경우 왼쪽 상단에서 Site admin(사이트 관리자)을 클릭합니다.

  3. " 사이트 관리자" 사이드바에서 관리 콘솔 을 클릭합니다.

  4. 설정에서 사이드바의 프라이버시 탭을 클릭하세요.

  5. Under External load balancers, select Allow HTTP X-Forwarded-For header.

  6. "설정" 사이드바에서 설정 저장을 클릭합니다.

    참고: 관리 콘솔에 설정을 저장하면 시스템 서비스가 다시 시작되어 사용자에게 표시되는 가동 중지 시간이 발생할 수 있습니다.

  7. 구성 실행이 완료될 때까지 기다립니다.

PROXY 지원 없이 사용할 프로토콜 TCP 포트 매핑

원본 포트대상 포트서비스 설명
2222SSH를 통한 Git
2525SMTP
8080HTTP
443443HTTPS
80808080관리 콘솔 HTTP
84438443관리 콘솔 HTTPS

Configuring health checks

Health checks allow a load balancer to stop sending traffic to a node that is not responding if a pre-configured check fails on that node. If the instance is offline due to maintenance or unexpected failure, the load balancer can display a status page. In a High Availability (HA) configuration, a load balancer can be used as part of a failover strategy. However, automatic failover of HA pairs is not supported. You must manually promote the replica instance before it will begin serving requests. For more information, see "고가용성 구성."

다음 URL을 확인하도록 Load Balancer를 구성합니다.

http(s)://HOSTNAME/status

노드가 정상이고 서비스 최종 사용자 요청에 사용할 수 있는 경우 엔드포인트는 상태 코드 200(OK)을 반환합니다. 자세한 내용은 "고가용성 구성 모니터링"을(를) 참조하세요.

참고: 어플라이언스가 유지 관리 모드인 경우 https://HOSTNAME/status URL은 상태 코드 503(서비스를 사용할 수 없음)을 반환합니다. 자세한 내용은 "유지 관리 모드 사용 설정 및 예약"을(를) 참조하세요.

Troubleshooting connectivity through a load balancer

If you cannot connect to services on GitHub Enterprise Server 인스턴스 through a load balancer, you can review the following information to troubleshoot the problem.

Note: Always test changes to your network infrastructure and instance configuration in a staging environment. For more information, see "Setting up a staging instance."

Error: "Your session has expired" for connections to the 관리 콘솔

If you enable support for the X-Forwarded-For header on your instance and load balancer, you may not be able to access your instance's 관리 콘솔. For more information about the 관리 콘솔 and ports required for connections, see "관리 웹 UI에서 인스턴스 등록" and "Network ports."

If GitHub Enterprise Server 인스턴스 indicates that your session has expired when you connect to the 관리 콘솔 through a load balancer, try one of the following configurations on your load balancer.

For more information, refer to the documentation for your load balancer.

Live updates to issues and check runs not working

When GitHub Enterprise Server 인스턴스 is accessed via a load balancer or reverse proxy, expected live updates, such as new comments on issues and changes in notification badges or check run output, may not display until the page is refreshed. This is most common when the reverse proxy or load balancer is running in a layer 7 mode or does not support the required websocket protocol.

To enable live updates, you may need to reconfigure the load balancer or proxy. For more information, refer to the documentation for your load balancer.