"error_page" can not be used in the "return" of "if"

Xia Qingran qingran.xia at gmail.com
Mon Aug 24 10:46:06 MSD 2009

I am running nginx-0.7.61 on my FreeBSD box, and I have taken the 403
error page to a static html in server context as follows,
error_page 403 /my-403.html;

In my "if" condition of the same server context, I write:
if (my condition) {
    return 403;
In my opinion, I want nginx returns my-403.html in this condition, not
the default 403 error page.

Can anyone tell me how to do this ?


Xia Qingran
qingran.xia at gmail.com
Sent from Beijing, 11, China
Ted Turner  - "Sports is like a war without the killing." -

More information about the nginx mailing list