Skip to content

Commit b7ca5dc

Browse files
authoredAug 18, 2022
Update nginx config in line with central (#630)
Co-authored-by: alxndrsn <alxndrsn>
1 parent 8233c9b commit b7ca5dc

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed
 

‎Procfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
vue: vue-cli-service build --mode development --watch
2-
nginx: nginx -c "$PWD/nginx.conf" -p "$PWD"
2+
nginx: nginx -c "$PWD/main.nginx.conf" -p "$PWD"

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ ODK Central Frontend communicates with ODK Central Backend in part using a sessi
6060

6161
To build ODK Central Frontend files for production with minification, run `npm run build`. The files will be outputted to `dist/`. For more details on this command, see the [documentation](https://cli.vuejs.org/) for Vue CLI.
6262

63-
Note that this repository's `nginx.conf` is for development only.
63+
Note that this repository's `main.nginx.conf` is for development only.
6464

6565
For more information on deploying to production, see the [`central`](https://github.com/getodk/central) repository.

‎common-headers.nginx.conf

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file should be included in server{}, and also in any location{}
2+
# which has a call to add_header.
3+
# See: https://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header
4+
5+
add_header Strict-Transport-Security "max-age=63072000" always;
6+
add_header X-Frame-Options "SAMEORIGIN";
7+
add_header X-Content-Type-Options nosniff;

‎docs/enketo.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Enketo runs as a Node.js server and caches intermediate representations of forms
4747

4848

4949
### Notes on existing Central Frontend configuration
50-
- The following lines have already been added to [`nginx.conf`](../nginx.conf). They create a reverse proxy for the Enketo server in the same way as the reverse proxy to the ODK Central Backend server.
50+
- The following lines have already been added to [`main.nginx.conf`](../main.nginx.conf). They create a reverse proxy for the Enketo server in the same way as the reverse proxy to the ODK Central Backend server.
5151

5252
```
5353
location /- {

‎nginx.conf ‎main.nginx.conf

+3-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ http {
5353

5454
server_tokens off;
5555

56-
add_header X-Frame-Options "SAMEORIGIN";
57-
add_header X-Content-Type-Options nosniff;
56+
include ./common-headers.nginx.conf;
5857

5958
client_max_body_size 100m;
6059

@@ -74,6 +73,7 @@ http {
7473
proxy_pass http://localhost:8383;
7574
proxy_redirect off;
7675

76+
include ./common-headers.nginx.conf;
7777
add_header Set-Cookie $session_cookie;
7878
proxy_set_header X-Forwarded-Proto https;
7979

@@ -87,6 +87,7 @@ http {
8787
root ./dist;
8888

8989
location /index.html {
90+
include ./common-headers.nginx.conf;
9091
add_header Cache-Control no-cache;
9192
}
9293
}

‎src/components/form-attachment/list.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export default {
239239
a relatively low-resource device: we expect that a CSV file will not exceed
240240
a few dozen MBs.
241241

242-
Note that the development nginx.conf does not support request body
242+
Note that the development main.nginx.conf does not support request body
243243
decompression. That means that in development, if this component gzips a CSV
244244
file, Backend will store the gzipped contents rather than the file's
245245
original contents.

0 commit comments

Comments
 (0)
Please sign in to comment.