From 5bbb3b67522ad0d3a00e3330f9e784fff8fcd05d Mon Sep 17 00:00:00 2001 From: metalicn20 Date: Sun, 29 May 2022 15:30:13 +0430 Subject: [PATCH 1/2] Move CORS config to http context --- nginx.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nginx.conf b/nginx.conf index 5cd9b44..5324c4b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -71,6 +71,11 @@ http { proxy_hide_header Access-Control-Allow-Headers; proxy_hide_header Access-Control-Allow-Methods; + add_header Access-Control-Allow-Credentials false always; + add_header Access-Control-Allow-Origin * always; + add_header Access-Control-Allow-Headers * always; + add_header Access-Control-Allow-Methods 'POST, PUT, PATCH, GET, DELETE, OPTIONS, HEAD' always; + proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -135,11 +140,6 @@ http { limit_req zone=default burst=5 nodelay; - add_header Access-Control-Allow-Credentials false always; - add_header Access-Control-Allow-Origin * always; - add_header Access-Control-Allow-Headers * always; - add_header Access-Control-Allow-Methods 'POST, PUT, PATCH, GET, DELETE, OPTIONS, HEAD' always; - if ($request_method = 'OPTIONS') { return 204; } From f24d70effe1472b75d4f116f793281f9f4ae766b Mon Sep 17 00:00:00 2001 From: metalicn20 Date: Sun, 29 May 2022 15:33:02 +0430 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 232d4fa..83d1e69 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# OPEX-Nginx -Nginx's docker configurations for OPEX exchange +# reverse-proxy +Configuring NGINX as reverse proxy for OPEX exchange \ No newline at end of file