WEB-506 feat: add Remittance Module with 7-step payout wizard (#3200)
WEB-506 fix: address CodeRabbit review (security, validation) WEB-506 fix: make API gateway header name configurable (MIFOS_REMITTANCE_API_HEADER) WEB-506 fix: remove duplicate translation keys (Personal Information, Transaction Details)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
# Rate limiting zone for external National ID API (2 requests/second per IP)
|
||||
limit_req_zone $binary_remote_addr zone=external_nationalid:10m rate=2r/s;
|
||||
|
||||
# Rate limiting zone for Remittance API (2 requests/second per IP)
|
||||
limit_req_zone $binary_remote_addr zone=remittance_api:10m rate=2r/s;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
@@ -46,6 +49,30 @@ server {
|
||||
# CORS is not needed since requests come from the same origin
|
||||
}
|
||||
|
||||
# Remittance API proxy
|
||||
location /remittance-api {
|
||||
resolver 127.0.0.11 valid=30s;
|
||||
|
||||
# Rate limit to prevent abuse of the upstream Remittance API
|
||||
limit_req zone=remittance_api burst=5 nodelay;
|
||||
|
||||
set $remittance_target "${MIFOS_REMITTANCE_API_URL}";
|
||||
|
||||
# Rewrite path: /remittance-api/... -> /1.0/remittance/...
|
||||
rewrite ^/remittance-api(.*)$ /1.0/remittance$1 break;
|
||||
|
||||
proxy_pass $remittance_target;
|
||||
proxy_set_header Host $proxy_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;
|
||||
|
||||
# Inject API key server-side so it is never exposed to the browser
|
||||
proxy_set_header ${MIFOS_REMITTANCE_API_HEADER} "${MIFOS_REMITTANCE_API_KEY}";
|
||||
|
||||
proxy_pass_request_headers on;
|
||||
}
|
||||
|
||||
# Angular app - serve index.html for all routes
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
Reference in New Issue
Block a user