Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NginX] if문에 조건을 and로 넣고 싶을 때 #5

Open
cyjo9603 opened this issue Sep 12, 2021 · 0 comments
Open

[NginX] if문에 조건을 and로 넣고 싶을 때 #5

cyjo9603 opened this issue Sep 12, 2021 · 0 comments
Assignees

Comments

@cyjo9603
Copy link
Member

문제발생

  • NginX에서 요청의 cookie를 검사해야하는 로직이 있는데 NginX의 if문은 and 및 or 조건을 지원하지 않음

해결방법

if (cond1) {
  set $valid_req TR;
}

if (cond2) {
  set $has_iims_info "${valid_req}UE";
}

if ($has_iims_info = TRUE) {
  # success
}

다음과 같이 조건마다 문자열로 변수에 "TR", "UE" 값을 추가해 최종 값이 "TRUE"인지 확인

@cyjo9603 cyjo9603 self-assigned this Sep 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant