commit a7f5ca6cf37a6df0675bc9a29389d8607b127d60 Author: Михаил Капелько Date: Fri Nov 13 15:22:59 2020 +0300 nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..ff14a62 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,29 @@ + +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + server { + listen 8888; + server_name localhost; + location / { + add_header 'Access-Control-Allow-Origin' '*' always; + proxy_pass http://127.0.0.1:3000; + + # Preflight. + if ($request_method = OPTIONS) { + add_header "Access-Control-Allow-Origin" *; + add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD, DELETE"; + add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept"; + return 200; + } + } + } +}