最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

nginx proxy pass issue - Stack Overflow

programmeradmin1浏览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;
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 ;
}

location /myapps/ {
    if ($redirect = 0) {
       return 301 https://controlcenter-$arg_env.xyz/enterprise/myapps/;
    }
    proxy_pass /;
}

location = /myapps {
    if ($redirect = 0) {
       return 301 https://controlcenter-$arg_env.xyz/enterprise/myapps/;
    }
    proxy_pass /;
}

}

When the URL is hit with /?env=test4&**internal=true** getting a blank page and in the browser console getting the message something like this - GET / 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.

发布评论

评论列表(0)

  1. 暂无评论