Welcome! Log In Create A New Profile

Advanced

Setting the status code

Dennis Jacobfeuerborn
August 05, 2013 11:04PM
Hi,
I'm wondering how I can set a status code and still deliver a custom web
page? Specifically I want to use a status code of 403 Forbidden but
depending on the exact reason I want to display different custom error
pages for that case.
When I use the "return 403" directive I can no longer deliver content
and at most a single custom page can be returned which is defined by the
error_page directive.

Since I determine the reason for the denied access in lua a way to do it
there would also help. I already tried "nginx.status = 403" followed by
a "nginx.exec('/reason1')" but while the right page is display the
status code returned gets reset to 200.

Any ideas?

Regards,
Dennis

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Setting the status code

Dennis Jacobfeuerborn August 05, 2013 11:04PM

Re: Setting the status code

mex August 06, 2013 02:29AM

Re: Setting the status code

Dennis Jacobfeuerborn August 06, 2013 07:04AM

Re: Setting the status code

dbradfield August 06, 2013 07:32AM

Re: Setting the status code

Dennis Jacobfeuerborn August 06, 2013 06:20PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 211
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