diff --git a/README.md b/README.md index c3d6d06093d0b1feb66f941ef82ef8668c0a4014..e942ea7ede6b9bea577703d5b3e12f6163f4349d 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: