0

I'm trying to set the value of set_real_ip_from from a variable but I'm getting an error.

NGINX Config:

set $frontendIP "104.22.100.4/32"; set_real_ip_from 103.21.244.0/22; set_real_ip_from 103.22.200.0/22; set_real_ip_from $frontendIP; 

Error:

nginx: [emerg] host not found in set_real_ip_from "$frontendIP" 

The problem is not in setting the variable, but set_real_ip_from returning an error.

3
  • Does this answer your question? nginx set variable in location Commented Jan 3, 2022 at 12:29
  • Also see nginx.org/en/docs/faq/variables_in_config.html Commented Jan 3, 2022 at 12:31
  • @AlexD, the problem isn't in setting the variable but set_real_ip_from isn't taking the variable and returning an error. Commented Jan 3, 2022 at 13:25

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.