Welcome! Log In Create A New Profile

Advanced

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

Xia Qingran
August 24, 2009 02:46AM
Hi,
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 ?

Thanks.

--
夏清然
Xia Qingran
qingran.xia@gmail.com
Sent from Beijing, 11, China
Ted Turner - "Sports is like a war without the killing." -
http://www.brainyquote.com/quotes/authors/t/ted_turner.html
Subject Author Posted

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

Xia Qingran August 24, 2009 02:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 166
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready