> 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/de/konfiguration/overleaf-toolkit/tls-proxy.md).

# TLS-Proxy

Ein optionaler TLS-Proxy zum Beenden von HTTPS-Verbindungen mit NGINX.

Führen Sie `bin/init --tls` um die lokale Konfiguration mit der NGINX-Proxy-Konfiguration zu initialisieren oder die NGINX-Proxy-Konfiguration zu einer vorhandenen lokalen Konfiguration hinzuzufügen. A **Beispiel** privater Schlüssel wird erstellt in `config/nginx/certs/overleaf_key.pem` und ein **Platzhalter** Zertifikat in `config/nginx/certs/overleaf_certificate.pem`. Ersetzen Sie diese entweder durch Ihren tatsächlichen privaten Schlüssel und Ihr Zertifikat, oder setzen Sie die Werte der `TLS_PRIVATE_KEY_PATH` und `TLS_CERTIFICATE_PATH` Variablen jeweils auf die Pfade Ihres tatsächlichen privaten Schlüssels und Zertifikats.

Eine Standardkonfiguration für NGINX ist in `config/nginx/nginx.conf` die an Ihre Anforderungen angepasst werden kann. Der Pfad zur Konfigurationsdatei kann mit der `NGINX_CONFIG_PATH` Variable geändert werden.

{% hint style="success" %}
Wenn Sie eine **docker-compose.yml** basierte Bereitstellung haben oder Ihren eigenen NGINX-Reverse-Proxy verwalten, können Sie ein Beispiel ansehen **nginx.conf** Datei [hier](https://github.com/overleaf/toolkit/blob/master/lib/config-seed/nginx.conf).
{% endhint %}

Fügen Sie den folgenden Abschnitt zu Ihrer `config/overleaf.rc` Datei hinzu, falls er noch nicht vorhanden ist:

```
# TLS-Proxy-Konfiguration (optional)
NGINX_ENABLED=false
NGINX_CONFIG_PATH=config/nginx/nginx.conf
NGINX_HTTP_PORT=80

# Ersetzen Sie diese IP-Adressen durch die externe IP-Adresse Ihres Hosts
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" %}
Wenn Sie einen externen TLS-Proxy verwenden (d. h. nicht vom Overleaf Toolkit verwaltet), stellen Sie bitte sicher, dass `OVERLEAF_TRUSTED_PROXY_IPS=loopback,<ip-of-your-tls-proxy>` in Ihrer `config/variables.env`, z. B. `OVERLEAF_TRUSTED_PROXY_IPS=loopback,192.168.13.37`.
{% endhint %}

{% hint style="danger" %}
Wenn Sie ein Subnetz aus `172.16.0.0/12` (Standard-Subnetz für Docker-Netzwerke) für Ihr lokales Netzwerk verwenden, müssen Sie `OVERLEAF_TRUSTED_PROXY_IPS=loopback,<network>` in Ihrer `config/variables.env`. Wobei `<network>` das `IPAM -> Config -> Subnet` der Wert in `docker inspect overleaf_default`, z. B. `OVERLEAF_TRUSTED_PROXY_IPS=loopback,172.19.0.0/16`. Dies ist dazu da, das Vortäuschen von `X-Forwarded` Header setzen.
{% endhint %}

{% hint style="info" %}
Wenn der `OVERLEAF_TRUSTED_PROXY_IPS` nicht manuell gesetzt ist, ist der Standardwert `loopback`. Wenn Sie ihn manuell setzen, müssen Sie sicherstellen, dass Sie eines von `loopback`, `localhost` oder `127.0.0.1`, das dem **nginx** im **sharelatex** -Container.
{% endhint %}

Um den Proxy auszuführen, ändern Sie den Wert von `NGINX_ENABLED` Variablen in `config/overleaf.rc` Von `false` auf `true` und führen Sie erneut `bin/up`.

Standardmäßig ist die HTTPS-Weboberfläche verfügbar unter `https://127.0.1.1:443`. Verbindungen zu `http://127.0.1.1:80` werden umgeleitet zu `https://127.0.1.1:443`. Um die IP-Adresse zu ändern, auf der NGINX lauscht, setzen Sie die `NGINX_HTTP_LISTEN_IP` und `NGINX_TLS_LISTEN_IP` Variablen. Die Ports können über die `NGINX_HTTP_PORT` und `TLS_PORT` Variablen geändert werden.

Wenn NGINX mit der Fehlermeldung nicht startet `Error starting userland proxy: listen tcp4 ... bind: address already in use` stellen Sie sicher, dass `OVERLEAF_LISTEN_IP:OVERLEAF_PORT` sich nicht mit `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/de/konfiguration/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.
