From 1cb22b3f2b2f40d1b35807cfd917ed81bb2ddd7f Mon Sep 17 00:00:00 2001 From: Peyman Date: Sat, 17 May 2025 13:09:44 +0330 Subject: [PATCH 1/9] Testing config --- nginx.conf | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/nginx.conf b/nginx.conf index b1ac5d1..1758c24 100644 --- a/nginx.conf +++ b/nginx.conf @@ -157,6 +157,36 @@ http { } } + server { + listen 443 ssl; + listen [::]:443 ssl; + + server_name $SERVER_NAME_KC; + + location / { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + proxy_set_header Host $host; + proxy_pass http://keycloak:8080; + } + } + + server { + listen 443 ssl; + listen [::]:443 ssl; + + server_name $SERVER_NAME_V2_AUTH; + + location / { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Authorization $http_authorization; + proxy_pass http://auth-gateway:8080; + } + } + server { listen 443 ssl; listen [::]:443 ssl; From 47f11d82a0c7ecf64405ce6ddc562a424b8b30f5 Mon Sep 17 00:00:00 2001 From: Peyman Date: Sat, 31 May 2025 18:56:58 +0330 Subject: [PATCH 2/9] Add v2api config --- nginx.conf | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/nginx.conf b/nginx.conf index 1758c24..65195b3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -177,6 +177,10 @@ http { server_name $SERVER_NAME_V2_AUTH; + if ($request_method = 'OPTIONS') { + return 204; + } + location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -187,6 +191,27 @@ http { } } + server { + listen 443 ssl; + listen [::]:443 ssl; + + server_name v2api.opex.dev; + + if ($request_method = 'OPTIONS') { + return 204; + } + + location / { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Authorization $http_authorization; + proxy_pass http://api:8080; + rewrite ^/(.*)$ /opex/$1 break; + } + } + server { listen 443 ssl; listen [::]:443 ssl; From 307b19db00106c339d5fcced90838cf2ac1c9885 Mon Sep 17 00:00:00 2001 From: Amir Rajabi <34955519+AmirRajabii@users.noreply.github.com> Date: Sat, 19 Jul 2025 18:11:57 +0330 Subject: [PATCH 3/9] add profile --- nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nginx.conf b/nginx.conf index 65195b3..df7a533 100644 --- a/nginx.conf +++ b/nginx.conf @@ -390,6 +390,12 @@ http { proxy_pass $backend; rewrite ^/api/(.*)$ /$1 break; } + + location /profile { + set $backend http://profile:8080; + proxy_pass $backend; + rewrite ^/profile/(.*)$ /$1 break; + } location /sapi { set $backend http://api:8080; From d1b98649108ec0a27619d15746e004d4c6ba2230 Mon Sep 17 00:00:00 2001 From: Peyman Date: Tue, 29 Jul 2025 14:06:21 +0330 Subject: [PATCH 4/9] Add ip configs --- nginx.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nginx.conf b/nginx.conf index 65195b3..e594f14 100644 --- a/nginx.conf +++ b/nginx.conf @@ -166,6 +166,8 @@ http { location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_pass http://keycloak:8080; } @@ -186,6 +188,7 @@ http { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; proxy_set_header Authorization $http_authorization; proxy_pass http://auth-gateway:8080; } From 1f9b4bfdff967d0d766b1f52dd16b43c1cbaa7bd Mon Sep 17 00:00:00 2001 From: Amir Rajabi <34955519+AmirRajabii@users.noreply.github.com> Date: Wed, 3 Sep 2025 13:26:15 +0330 Subject: [PATCH 5/9] Add bc-gateway --- nginx.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nginx.conf b/nginx.conf index 1d88deb..914cc18 100644 --- a/nginx.conf +++ b/nginx.conf @@ -399,6 +399,11 @@ http { proxy_pass $backend; rewrite ^/profile/(.*)$ /$1 break; } + location /bc-gateway { + set $backend http://bc-gateway:8080; + proxy_pass $backend; + rewrite ^/bc-gateway/(.*)$ /$1 break; + } location /sapi { set $backend http://api:8080; From 4dd660299fc89a6e4d0f906304e10fea5be3c1ef Mon Sep 17 00:00:00 2001 From: Amir Rajabi <34955519+AmirRajabii@users.noreply.github.com> Date: Wed, 3 Sep 2025 14:30:21 +0330 Subject: [PATCH 6/9] Remove bc-gateway --- nginx.conf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/nginx.conf b/nginx.conf index 914cc18..1d88deb 100644 --- a/nginx.conf +++ b/nginx.conf @@ -399,11 +399,6 @@ http { proxy_pass $backend; rewrite ^/profile/(.*)$ /$1 break; } - location /bc-gateway { - set $backend http://bc-gateway:8080; - proxy_pass $backend; - rewrite ^/bc-gateway/(.*)$ /$1 break; - } location /sapi { set $backend http://api:8080; From 63ba56e9299a6797045669179aac8ef6c62db17e Mon Sep 17 00:00:00 2001 From: Amir Rajabi <34955519+AmirRajabii@users.noreply.github.com> Date: Sun, 2 Nov 2025 15:43:38 +0330 Subject: [PATCH 7/9] Add auth gateway health check --- nginx.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nginx.conf b/nginx.conf index 1d88deb..5e0c743 100644 --- a/nginx.conf +++ b/nginx.conf @@ -280,6 +280,11 @@ http { proxy_pass $backend; rewrite ^/auth(.*)$ /actuator/health/$1 break; } + location /auth-gateway { + set $backend http://auth-gateway:8080; + proxy_pass $backend; + rewrite ^/auth-gateway(.*)$ /actuator/health/$1 break; + } location /wallet { set $backend http://wallet:8080; From 493573276f42b1a8b8b6a4e064db278938402816 Mon Sep 17 00:00:00 2001 From: fatemeh imanipour Date: Wed, 5 Nov 2025 19:19:07 +0330 Subject: [PATCH 8/9] Add bc location for handling chain scanner webhook --- nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nginx.conf b/nginx.conf index 5e0c743..fd48102 100644 --- a/nginx.conf +++ b/nginx.conf @@ -411,6 +411,12 @@ http { rewrite ^/sapi/(.*)$ /$1 break; } + location /bc { + set $backend http://bc-gateway:8080; + proxy_pass $backend; + rewrite ^/sapi/(.*)$ /$1 break; + } + location /captcha { add_header Access-Control-Allow-Credentials true always; add_header Access-Control-Allow-Origin $http_origin always; From a25dcb9d438dc2f4d030f8803b27d01ff0318858 Mon Sep 17 00:00:00 2001 From: fatemeh imanipour Date: Wed, 5 Nov 2025 19:40:31 +0330 Subject: [PATCH 9/9] Fix the bc location --- nginx.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nginx.conf b/nginx.conf index fd48102..7b794bd 100644 --- a/nginx.conf +++ b/nginx.conf @@ -412,10 +412,10 @@ http { } location /bc { - set $backend http://bc-gateway:8080; - proxy_pass $backend; - rewrite ^/sapi/(.*)$ /$1 break; - } + set $backend http://bc-gateway:8080; + proxy_pass $backend; + rewrite ^/bc/(.*)$ /$1 break; + } location /captcha { add_header Access-Control-Allow-Credentials true always;