thank you very much, but i sitll want to know why error_page can't work normally in if block.
I see the error_page 's context can be " if in location" in the document.
the whole location conf like below, error_page can not work:
client_max_body_size 50k;
location / {
set $var "haha";
if ($var = "haha") {
error_page 413 /413.html;
}
}
but
client_max_body_size 50k;
location / {
error_page 413 /413.html;
}
it works!
and
location / {
set $var "haha";
if ($var = "haha") {
error_page 404 /404.html;
}
}
it also works!
thanks!