Route payment bank callbacks through storefront domains.

ZarinPal rejects api.meshkee.com when the terminal is registered to the store apex; nginx now proxies /meshkee/payments/{gateway}/callback to a host-scoped API route.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-25 21:34:56 +03:30
co-authored by Cursor
parent 40284df880
commit e942348b1d
13 changed files with 514 additions and 22 deletions
+25
View File
@@ -162,6 +162,28 @@ server {
add_header Cache-Control "public, max-age=900";
}
location = /meshkee/payments/zarinpal/callback {
proxy_pass https://api.meshkee.com/api/v1/tenants/${HOST}/payments/zarinpal/callback;
proxy_set_header Host api.meshkee.com;
proxy_ssl_server_name on;
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_pass_request_body on;
proxy_pass_request_headers on;
}
location = /meshkee/payments/mellat/callback {
proxy_pass https://api.meshkee.com/api/v1/tenants/${HOST}/payments/mellat/callback;
proxy_set_header Host api.meshkee.com;
proxy_ssl_server_name on;
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_pass_request_body on;
proxy_pass_request_headers on;
}
location / {
proxy_pass http://127.0.0.1:${PORT};
proxy_http_version 1.1;
@@ -185,6 +207,9 @@ else
if [[ -x "$SCRIPT_DIR/patch-nginx-seo.sh" ]]; then
"$SCRIPT_DIR/patch-nginx-seo.sh" "$HOST" || true
fi
if [[ -x "$SCRIPT_DIR/patch-nginx-pay.sh" ]]; then
"$SCRIPT_DIR/patch-nginx-pay.sh" "$HOST" || true
fi
fi
# SSL is issued separately via ssl.sh / Super Admin "Issue SSL" — do not run