From 8b73f3126efb4e1404a277c4a7bf34c8b76349d4 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 22 Oct 2025 11:50:33 +0000 Subject: [PATCH 1/3] Move nginx config files to subdirectory * tidy up the repo a little * prepare for potential changes to the config in e.g. #1376 --- Procfile | 2 +- README.md | 2 +- docs/enketo.md | 2 +- .../common-headers.nginx.conf | 0 main.nginx.conf => nginx-conf/main.nginx.conf | 0 5 files changed, 3 insertions(+), 3 deletions(-) rename common-headers.nginx.conf => nginx-conf/common-headers.nginx.conf (100%) rename main.nginx.conf => nginx-conf/main.nginx.conf (100%) diff --git a/Procfile b/Procfile index d7289410e..12a1ee2e9 100644 --- a/Procfile +++ b/Procfile @@ -1,3 +1,3 @@ vite: vite dev build: vite build --mode development --watch -nginx: nginx -c "$PWD/main.nginx.conf" -p "$PWD" +nginx: nginx -c "$PWD/nginx-conf/main.nginx.conf" -p "$PWD" diff --git a/README.md b/README.md index 38de2bb89..913316580 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,6 @@ If you run `npm run dev`, open ODK Central Frontend in a browser, then update th To build ODK Central Frontend files for production with minification, run `npm run build`. The files will be outputted to `dist/`. -Note that this repository's `main.nginx.conf` is for development only. +Note that the nginx configuration files in `./nginx-conf` are for development only. For more information on deploying to production, see the [`central`](https://github.com/getodk/central) repository. diff --git a/docs/enketo.md b/docs/enketo.md index b7f0c70a3..9c8d07bdc 100644 --- a/docs/enketo.md +++ b/docs/enketo.md @@ -47,7 +47,7 @@ ODK Central Backend is already configured to connect with Enketo. The following }, ``` -ODK Central Frontend is also already configured for Enketo as well. The following lines should already be in [`main.nginx.conf`](../main.nginx.conf) to create a reverse proxy to Enketo. +ODK Central Frontend is also already configured for Enketo as well. The following lines should already be in [`./nginx-conf/main.nginx.conf`](../nginx-conf/main.nginx.conf) to create a reverse proxy to Enketo. ``` location /- { diff --git a/common-headers.nginx.conf b/nginx-conf/common-headers.nginx.conf similarity index 100% rename from common-headers.nginx.conf rename to nginx-conf/common-headers.nginx.conf diff --git a/main.nginx.conf b/nginx-conf/main.nginx.conf similarity index 100% rename from main.nginx.conf rename to nginx-conf/main.nginx.conf From e9b9c06dff7a240fae93b408c847f43042d92f22 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Tue, 13 Jan 2026 12:41:57 +0000 Subject: [PATCH 2/3] rename common-headers --- .../{common-headers.nginx.conf => common-headers.conf} | 0 nginx-conf/main.nginx.conf | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) rename nginx-conf/{common-headers.nginx.conf => common-headers.conf} (100%) diff --git a/nginx-conf/common-headers.nginx.conf b/nginx-conf/common-headers.conf similarity index 100% rename from nginx-conf/common-headers.nginx.conf rename to nginx-conf/common-headers.conf diff --git a/nginx-conf/main.nginx.conf b/nginx-conf/main.nginx.conf index 69ce7e9a9..6e69927c4 100644 --- a/nginx-conf/main.nginx.conf +++ b/nginx-conf/main.nginx.conf @@ -67,7 +67,7 @@ http { server_tokens off; - include ./common-headers.nginx.conf; + include ./common-headers.conf; client_max_body_size 100m; @@ -137,7 +137,7 @@ http { # first cookie ending in "session" to be the session cookie add_header Set-Cookie $session_cookie; # re-add common headers after add_header call - include ./common-headers.nginx.conf; + include ./common-headers.conf; # Trick central-backend from thinking connections are coming # over HTTPS so that ExpressJS will set "secure" cookies. @@ -145,7 +145,7 @@ http { } location = /client-config.json { - include ./common-headers.nginx.conf; + include ./common-headers.conf; return 200 "{}"; } location /version.txt { @@ -157,7 +157,7 @@ http { root ./dist; try_files $uri $uri/ /index.html; - include ./common-headers.nginx.conf; + include ./common-headers.conf; # We return this header for more files in development than we do in # production. That's needed because in development, unlike production, # many file names don't contain hashes. From df7405cd9156a0d1027cbac5a117e26ee0107df4 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Tue, 13 Jan 2026 12:44:36 +0000 Subject: [PATCH 3/3] rename nginx-config/main.conf --- Procfile | 2 +- docs/enketo.md | 2 +- nginx-conf/{main.nginx.conf => main.conf} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename nginx-conf/{main.nginx.conf => main.conf} (100%) diff --git a/Procfile b/Procfile index 12a1ee2e9..727beee91 100644 --- a/Procfile +++ b/Procfile @@ -1,3 +1,3 @@ vite: vite dev build: vite build --mode development --watch -nginx: nginx -c "$PWD/nginx-conf/main.nginx.conf" -p "$PWD" +nginx: nginx -c "$PWD/nginx-conf/main.conf" -p "$PWD" diff --git a/docs/enketo.md b/docs/enketo.md index 9c8d07bdc..fb64d38c7 100644 --- a/docs/enketo.md +++ b/docs/enketo.md @@ -47,7 +47,7 @@ ODK Central Backend is already configured to connect with Enketo. The following }, ``` -ODK Central Frontend is also already configured for Enketo as well. The following lines should already be in [`./nginx-conf/main.nginx.conf`](../nginx-conf/main.nginx.conf) to create a reverse proxy to Enketo. +ODK Central Frontend is also already configured for Enketo as well. The following lines should already be in [`./nginx-conf/main.conf`](../nginx-conf/main.conf) to create a reverse proxy to Enketo. ``` location /- { diff --git a/nginx-conf/main.nginx.conf b/nginx-conf/main.conf similarity index 100% rename from nginx-conf/main.nginx.conf rename to nginx-conf/main.conf