Problem on new domain redirection. Cloudflare / NGINX config

Hi community,

We have problems to debug domain redirections at popsy.app, where we are not able to configure a couple of extra domains to be working as expected.
We are trying to configure the following popsy.ae and popsy.sa domains
We do have NGINX configuration for each domain like following

# popsy.ae
server {
  server_name popsy.ae;

  # Stripe domain verification
  location = /.well-known/apple-developer-merchantid-domain-association {
    add_header 'Content-Type' 'text/plain; charset=utf-8';
    try_files /.well-known/apple-developer-merchantid-domain-association =404;
    break;
  }

  location / {
    rewrite ^ https://www.popsy.ae$request_uri permanent;
  }

  # Uninstall Service workers
  if ($uri ~* "ngsw.json") {
    return 404;
  }
}

that for the use of popsy.ae
and

# *.popsy.ae
server {
  listen 443 ssl http2;
  server_name     www.popsy.ae *.popsy.ae;
  ssl_certificate /etc/ssl/certs/popsy.ae.pem;
  ssl_certificate_key /etc/ssl/certs/popsy.ae.key;
.... 

We have disabled any page redirects on Cloudflare and the DNS records are following the same as for popsy.app

The strange thing is that

https://popsy.ae redirects to https://www.popsy.app
while https://www.popsy.ae stays at that domain as expected

In the case of https://popsy.sa or https://www.popsy.sa redirect to https://www.popsy.app
while https://www.popsy.sa/products (or any other sub-url) works as expected

The dificult thing here seems to be realizing whether the config is missing at the DNS / Cloudflare side or at the NGINX side.
Any idea or suggestion on what may be happening or any suggestion on how to debug where do this redirects are applied from.
I can share full config if it will help

Thanks in Advance

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.