0
변수의 이전에 설정된 값을 덮어 쓰려면 어떻게해야합니까? 아래 시나리오에서는 $http_x_forwarded_proto = "https"
$redirectToHttps
이 false로 설정되지 않고 true로 설정됩니다. 나는이 값을 덮어 쓰길 기대하지만 그렇게하는 것은 아닙니다. 어떻게해야합니까? 의 nginx에서nginx 변수를 덮어 쓰는 법
location/{
set $redirectToHttps false;
set $environment "${APP_ENV}";
# determine if we should force https based on the environment
if ($environment = "production") {
set $redirectToHttps true;
}
if ($environment = "staging") {
set $redirectToHttps true;
}
# determine if we should force https based on the protocol
if ($scheme = "https") {
set $redirectToHttps false;
return 200 "redirectToHttps-scheme: false";
}
if ($http_x_forwarded_proto = "https") {
set $redirectToHttps false;
}
'$ http_x_forwarded_proto'가 실제로'https'로 설정되어 있습니까? – VBart
@VBart - 예, 확인했습니다. – Webnet
'$ redirectToHttps'가'true'로 남아 있는지 어떻게 확인합니까? – VBart