From e7173f5ec36672cd4266b771ff351816aea8ecac Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Fri, 28 Aug 2026 17:09:29 +0200 Subject: [PATCH] docs(config): simplify the simplified nginx example and update the advanced one --- docs/example-advanced.nginx.conf | 13 ++++++++++++- docs/example.nginx.conf | 6 +----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/example-advanced.nginx.conf b/docs/example-advanced.nginx.conf index 13ab79678..c8472c569 100644 --- a/docs/example-advanced.nginx.conf +++ b/docs/example-advanced.nginx.conf @@ -8,6 +8,17 @@ # installation (http server by the Nodejs process). If you are using CryptPad # in production and require professional support please contact sales@cryptpad.fr +# CryptPad possesses several nodes that can answer websocket requests. The +# following allows nginx to load-balance between them. +# The different `server` corresponds to the location of the different front +# nodes specified in your CryptPad `config/infra.js` file. If you change this +# setting, don’t forget to update the following list of servers +# The following works with config/infra.example.js: +upstream fronts { + server localhost:3010; + server localhost:3011; +} + server { listen 80; listen [::]:80; @@ -202,7 +213,7 @@ server { # Websocket traffic still needs to be handled by the main process, which means it needs # to be hosted on a different port. By default 3003 will be used, though this is configurable # via config.websocketPort - proxy_pass http://localhost:3003; + proxy_pass http://fronts; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/docs/example.nginx.conf b/docs/example.nginx.conf index ba6f4cf91..134bc48e9 100644 --- a/docs/example.nginx.conf +++ b/docs/example.nginx.conf @@ -14,10 +14,6 @@ # nodes specified in your CryptPad `config/infra.js` file. If you change this # setting, don’t forget to update the following list of servers # The following works with config/infra.example.js: -upstream fronts { - server localhost:3010; - server localhost:3011; -} server { listen 80; @@ -89,7 +85,7 @@ server { } location ^~ /cryptpad_websocket { - proxy_pass http://fronts; + proxy_pass http://localhost:3000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;