Welcome! Log In Create A New Profile

Advanced

auth_request own error_page

Posted by bAndie91 
auth_request own error_page
August 10, 2014 06:02AM
How to make an own error_page for auth_request?
I configurest nginx to check access for page "/something.php" (auth_request /auth). I want to return a custom error page when auth subrequest denies access (error_page 401 /unauth.html), AND I want keep the response body and headers when something.php denies access itself (php sets Status header).
Re: auth_request own error_page
October 11, 2014 10:23AM
Re: auth_request own error_page
October 12, 2014 10:55AM
I have done this by patching auth_request module to pass 441 and 443 custom http status codes throu, and then I defined "error_page 441 =401 /unauth.html" in nginx config. I make subrequest url to return "Status: 441" instead of 401, nginx error_page directive turns it to 401.



Edited 1 time(s). Last edit at 10/12/2014 10:55AM by bAndie91.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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