> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/on-premises/ko/configuration/overleaf-toolkit/tls-proxy.md).

# TLS 프록시

NGINX를 사용하여 HTTPS 연결을 종료하는 선택적 TLS 프록시.

실행하세요 `bin/init --tls` NGINX 프록시 구성으로 로컬 구성을 초기화하거나, 기존 로컬 구성에 NGINX 프록시 구성을 추가하기 위해. A **샘플** 개인 키는 다음 위치에 생성됩니다 `config/nginx/certs/overleaf_key.pem` 그리고 **더미** 인증서는 다음 위치에 있습니다 `config/nginx/certs/overleaf_certificate.pem`. 이들을 실제 개인 키와 인증서로 교체하거나, 다음 변수들의 값을 설정하세요: `TLS_PRIVATE_KEY_PATH` 그리고 `TLS_CERTIFICATE_PATH` 변수들의 값을 실제 개인 키와 인증서의 경로로 각각 설정하세요.

NGINX의 기본 구성은 다음에 제공됩니다 `config/nginx/nginx.conf` 필요에 맞게 사용자 지정할 수 있습니다. 구성 파일 경로는 다음으로 변경할 수 있습니다 `NGINX_CONFIG_PATH` 변수.

{% hint style="success" %}
만약 다음이 있다면 **docker-compose.yml** 기반 배포를 사용 중이거나 자체 NGINX 리버스 프록시를 관리하는 경우, 예시 **nginx.conf** 파일 [여기](https://github.com/overleaf/toolkit/blob/master/lib/config-seed/nginx.conf).
{% endhint %}

다음 섹션을 귀하의 `config/overleaf.rc` 파일에 아직 없다면 추가하세요:

```
# TLS 프록시 구성(선택 사항)
NGINX_ENABLED=false
NGINX_CONFIG_PATH=config/nginx/nginx.conf
NGINX_HTTP_PORT=80

# 로컬 네트워크의 외부 IP 주소로 이 IP 주소들을 교체하세요
NGINX_HTTP_LISTEN_IP=127.0.1.1 
NGINX_TLS_LISTEN_IP=127.0.1.1
TLS_PRIVATE_KEY_PATH=config/nginx/certs/overleaf_key.pem
TLS_CERTIFICATE_PATH=config/nginx/certs/overleaf_certificate.pem
TLS_PORT=443
```

{% hint style="danger" %}
외부 TLS 프록시(즉, Overleaf Toolkit에서 관리하지 않는)를 사용 중이라면, 다음이 `OVERLEAF_TRUSTED_PROXY_IPS=loopback,<ip-of-your-tls-proxy>` 가 다음에 설정되어 있는지 `config/variables.env`, 예: `OVERLEAF_TRUSTED_PROXY_IPS=loopback,192.168.13.37`.
{% endhint %}

{% hint style="danger" %}
다음의 서브넷을 사용 중이라면 `172.16.0.0/12` (Docker 네트워크의 기본 서브넷)를 로컬 네트워크에 사용 중인 경우, 다음을 설정해야 합니다 `OVERLEAF_TRUSTED_PROXY_IPS=loopback,<network>` 당신의 `config/variables.env`. 다음에서 `<network>` 다음입니다 `IPAM -> Config -> Subnet` 의 값 `docker inspect overleaf_default`, 예: `OVERLEAF_TRUSTED_PROXY_IPS=loopback,172.19.0.0/16`. 이는 다음의 스푸핑을 방지하기 위한 것입니다 `X-Forwarded` 헤더.
{% endhint %}

{% hint style="info" %}
만약 다음이 `OVERLEAF_TRUSTED_PROXY_IPS` 수동으로 설정되지 않으면 기본값은 다음과 같습니다 `loopback`. 수동으로 설정하는 경우, 다음 중 하나를 반드시 포함해야 합니다 `loopback`, `localhost` 또는 `127.0.0.1`, 이는 다음을 신뢰합니다 **nginx** 내부에서 실행 중인 인스턴스 **sharelatex** 컨테이너.
{% endhint %}

프록시를 실행하려면 다음의 값을 변경하세요 `NGINX_ENABLED` 변수로 설정되며, `config/overleaf.rc` 보내는 사람 `false` 에서 `true` 를 변경하고 다시 실행하세요 `bin/up`.

기본적으로 HTTPS 웹 인터페이스는 다음에서 사용할 수 있습니다 `https://127.0.1.1:443`. 다음으로의 연결은 `http://127.0.1.1:80` 로 리디렉션됩니다 `https://127.0.1.1:443`. NGINX가 수신할 IP 주소를 변경하려면 다음을 설정하세요 `NGINX_HTTP_LISTEN_IP` 그리고 `NGINX_TLS_LISTEN_IP` 변수입니다. 포트는 다음을 통해 변경할 수 있습니다 `NGINX_HTTP_PORT` 그리고 `TLS_PORT` 변수.

NGINX가 다음 오류 메시지와 함께 시작에 실패하면 `Error starting userland proxy: listen tcp4 ... bind: address already in use` 다음이 충돌하지 않는지 확인하세요 `OVERLEAF_LISTEN_IP:OVERLEAF_PORT` 가 다음과 겹치지 않도록 `NGINX_HTTP_LISTEN_IP:NGINX_HTTP_PORT`.

{% @mermaid/diagram content="sequenceDiagram
participant user as User
participant external as Host External
participant internal as Host Internal
participant nginx as nginx
participant sharelatex as sharelatex
participant git-bridge as git-bridge
%% User connects to external host HTTP
user->>+ external: HTTP
note over external: NGINX\_HTTP\_LISTEN\_IP:NGINX\_HTTP\_PORT
external->>+ nginx: HTTP
note over nginx: nginx:80
nginx-->>-external: 301
%% User connects to external host HTTPS
user->>+ external: HTTPS
note over external: NGINX\_TLS\_LISTEN\_IP:TLS\_PORT
external->>+ nginx: HTTPS
note over nginx: nginx:443
nginx->>+ sharelatex: HTTP
note over sharelatex: sharlatex:80
%% User connects to localhost HTTP
user->>+ internal: HTTP
note over internal: OVERLEAF\_LISTEN\_IP:OVERLEAF\_PORT
internal->>+sharelatex: HTTP
note over sharelatex: sharlatex:80
%% sharelatex connects to git-bridge
sharelatex->>+git-bridge: HTTP /git/
note over git-bridge: git-bridge:8000
note over sharelatex: GIT\_BRIDGE\_HOST:GIT\_BRIDGE\_PORT
git-bridge->>+sharelatex: WEB/WEB-API:3000
git-bridge->>+sharelatex: HISTORY-V1:3100" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/on-premises/ko/configuration/overleaf-toolkit/tls-proxy.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
