According to the documentation getting the value of $server_addr to set a response header makes a system call, and can impact performance negativelyset $ip $server_addr;
server {
location /health {
add_header Backend $server_addr;
return 200;
}
}
Would the following be a better solution, and eliminate the system call on every request?
server {
set $ip $server_addr;
location /health {
add_header Backend $ip always;
return 200;
}
}