diff --git a/doc/overleaf-rc.md b/doc/overleaf-rc.md index b08c969..1956743 100644 --- a/doc/overleaf-rc.md +++ b/doc/overleaf-rc.md @@ -22,10 +22,17 @@ Sets the path to the directory that will be mounted into the main `sharelatex` c - Default: data/sharelatex +### `SHARELATEX_LISTEN_IP` + +Sets the host IP address(es) that the container will bind to. For example, if this is set to `0.0.0.0`, then the web interface will be available on any host IP address. + +Setting `SHARELATEX_LISTEN_IP` to either `0.0.0.0` or the external IP of your host will typically cause errors when used in conjunction with the [TLS Proxy](tls-proxy.md). + +- Default: 127.0.0.1 ### `SHARELATEX_PORT` -Sets the host port that the container will bind to. For example, if this is set to `8099`, then the web interface will be available on `http://localhost:8099`. +Sets the host port that the container will bind to. For example, if this is set to `8099` and `SHARELATEX_LISTEN_IP` is set to `127.0.0.1`, then the web interface will be available on `http://localhost:8099`. When used in conjunction with the [TLS Proxy](tls-proxy.md), the `proxy_pass` port in [nginx.conf](config/nginx/nginx.conf) also needs to be changed. @@ -133,8 +140,24 @@ Path to the public certificate to use for the [TLS Proxy](tls-proxy.md). - Default: config/nginx/certs/overleaf_certificate.pem +### `NGINX_TLS_LISTEN_IP` + +Sets the host IP address(es) that the [TLS Proxy](tls-proxy.md) container will bind to for https. For example, if this is set to `0.0.0.0` then the https web interface will be available on any host IP address. + +Typically this should be set to the external IP of your host. + +- Default: 127.0.1.1 + ### `TLS_PORT` -Sets the host port that the [TLS Proxy](tls-proxy.md) container will bind to. For example, if this is set to `8443`, then the https web interface will be available on `https://localhost:8443`. +Sets the host port that the [TLS Proxy](tls-proxy.md) container will bind to for https. For example, if this is set to `8443`, then the https web interface will be available on `https://localhost:8443`. - Default: 443 + +### `NGINX_HTTP_LISTEN_IP` + +Sets the host IP address(es) that the [TLS Proxy](tls-proxy.md) container will bind to for http redirect. For example, if this is set to `127.0.1.1` then http connections to `127.0.1.1` will be redirected to the https web interface. + +Typically this should be set to the external IP of your host. Do not set it to `0.0.0.0` as this will typically cause a conflict with `SHARELATEX_LISTEN_IP`. + +- Default: 127.0.1.1 \ No newline at end of file diff --git a/doc/tls-proxy.md b/doc/tls-proxy.md index 6e572de..27e3c3d 100644 --- a/doc/tls-proxy.md +++ b/doc/tls-proxy.md @@ -17,6 +17,10 @@ Add the following section to your `config/overleaf.rc` file if it is not there a # See documentation in doc/tls-proxy.md NGINX_ENABLED=false NGINX_CONFIG_PATH=config/nginx/nginx.conf +NGINX_HTTP_PORT=80 +# Replace these IP addresses with the external IP address of your host +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 @@ -26,4 +30,6 @@ TLS_PORT=443 When the [SHARELATEX_PORT](overleaf-rc.md#sharelatex_port) variable is set, the port in the `proxy_pass` statement in `nginx.conf` needs to be changed to match. -By default the https web interface will be available on `https://localhost:443`. The port can be changed via the `TLS_PORT` variable. \ No newline at end of file +By default the https web interface will be available on `https://127.0.1.1:443`. Connections to `http://127.0.1.1:80` will be redirected to `https://127.0.1.1:443`. To change the IP address that NGINX listens on, set the `NGINX_HTTP_LISTEN_IP` and `NGINX_TLS_LISTEN_IP` variables. The ports can be changed via the `NGINX_HTTP_PORT` and `TLS_PORT` variables. + +If NGINX fails to start with the error message `Error starting userland proxy: listen tcp4 ... bind: address already in use` ensure that `SHARELATEX_LISTEN_IP:SHARELATEX_PORT` does not overlap with `NGINX_HTTP_LISTEN_IP:NGINX_HTTP_PORT`. \ No newline at end of file