From a7457ea5c4ec8ba40a1bb46e6ae01fed87393988 Mon Sep 17 00:00:00 2001 From: meskio <meskio@sindominio.net> Date: Fri, 19 Mar 2021 10:17:50 +0100 Subject: [PATCH] Document nginx configuration --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index c3d6d06..e942ea7 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,27 @@ Instead of flags all the params can be passed as env variables. See the names be ./cicer -h ``` +### nginx configuration + +The android app requires CORS to be configured in the server: + +``` +location / { + if ($request_method ~ ^(OPTIONS)$ ) { + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, OPTIONS'; + add_header Access-Control-Allow-Headers x-authentication; + return 200; + } + + add_header Access-Control-Allow-Origin * always; + add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, OPTIONS'; + add_header Access-Control-Allow-Headers x-authentication always; + + proxy_pass http://localhost:8000; +} +``` + ## Running it for development To run Cicer in development mode, build and run the backend: -- GitLab