0
map $arg_internal $redirect { default 0; "true" 1; } server { #Swap the following two lines to get the redirect working again server_name developer-nonprod.com; listen 9443 ssl; ssl_protocols TLSv1.2 TLSv1.3; ssl_certificate /etc/nginx/ssl/server.cer; ssl_certificate_key /etc/nginx/ssl/server.key; client_max_body_size 10M; location / { proxy_pass https://app.developer-nonprod.com; } location /myapps/ { if ($redirect = 0) { return 301 https://controlcenter-$arg_env.xyz.com/enterprise/myapps/; } proxy_pass https://nginx-master-po-liam-apiclient-admin.aks-odc.com/myapps/; } location = /myapps { if ($redirect = 0) { return 301 https://controlcenter-$arg_env.xyz.com/enterprise/myapps/; } proxy_pass https://nginx-master-po-liam-apiclient-admin.aks-odc.com/myapps/; } 

}

When the URL is hit with https://developer-nonprod.com/myapps/?env=test4&**internal=true** getting a blank page and in the browser console getting the message something like this - GET https://controlcenter-.xyz.com/enterprise/myapps/ net::ERR_NAME_NOT_RESOLVED

I am not sure why this was getting invoked as per the condition it should not go inside if block.

1
  • Looks really strange. Could there be another map block calculating the same named variable? Try nginx -T | grep $redirect command, maybe you'll find some clue? Commented Mar 14 at 5:18

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.