Skip to main content
Inside the pod, the container’s nginx serves plain HTTP on port 80. HTTPS ends in front of the pods: in your ingress controller, your cloud load balancer, or HAProxy as in Horizontal scaling. The Toolkit’s NGINX proxy (bin/init --tls, NGINX_* and TLS_* in overleaf.rc) has no counterpart; see TLS proxy for the Toolkit.

What the proxy must do

  • Pass WebSockets (/socket.io).
  • Allow requests of 10 minutes (long compiles) and request bodies of 50 MB (uploads), or MAX_UPLOAD_SIZE.
  • Keep its idle keep-alive timeout towards the pods below 65 seconds, the timeout of the nginx in the pod.
  • Send X-Forwarded-For and X-Forwarded-Proto: https.
  • With several replicas, keep a user on one replica, see Horizontal scaling.

ConfigMap

Without X-Forwarded-Proto: https from a trusted address, Ayakaleaf Pro thinks requests arrive over HTTP and does not set its secure session cookie: logins then fail. Set OVERLEAF_SECURE_COOKIE only when users really reach the site over HTTPS; any value turns it on, also "false".

HAProxy example

To terminate HTTPS in the HAProxy DaemonSet of Horizontal scaling, put the certificate and its key into one PEM file and a Secret:
Then change 80-haproxy.yaml:
80-haproxy.yaml (changes)
Bump config-hash so that HAProxy restarts, then set the ConfigMap as above and restart the replicas. The redirect keeps the port of the request: it suits a load balancer on ports 80 and 443, but on the NodePorts it sends http://host:30081 to https://host:30081. Without a load balancer in front, leave the redirect line out and give users the https://...:30443 address.

Tested on Kubernetes

On Kubernetes 1.37 with three replicas and HAProxy terminating HTTPS as above, with OVERLEAF_SITE_URL on https:// and OVERLEAF_SECURE_COOKIE: users activated through https:// links, logged in with a session cookie marked Secure, uploaded and compiled projects with the PDF fetched, stayed on their replica, opened the editor’s WebSocket (wss), and cloned and pushed with Git over HTTPS. http:// requests on the NodePort were redirected to https:// with the same port, as described above.
Last modified on November 2, 2026