That worked. Awesome and thanks a lot ! -- Karanby karanj - Nginx Mailing List - English
One correction - /tf/test.php - This file sets the header - header('X-ErrorPage: /tf2/test.php'); and then sends header("HTTP/1.1 401 Unauthorized");by karanj - Nginx Mailing List - English
It doesn't work for me. I have 3 files running under HipHop - 1) /tf/test.php - This file sets the session variable - $_SESSION['X-ErrorPage']='/tf2/test.php'; and then sends header("HTTP/1.1 401 Unauthorized"); 2) /tf2/test2.php - This prints "It works" 3) /tf2/test.php - This prints "Error Page" My config looks like this - The output on running http://11by karanj - Nginx Mailing List - English
One additional question here - In this as I understand it redirects to error_page on receiving a 4xx status code. Is it possible that nginx reads the value of error page from a custom header which comes along with the response (with 4xx status code) and then assign the value of error_page to that value.by karanj - Nginx Mailing List - English
Thanks it works !by karanj - Nginx Mailing List - English
Thanks for the response. For this - location /index.php { error_page 401 403 /not_authorized.html; auth_request /auth.php; proxy_pass http://hiphop:4247; } Does it mean that auth.php should be available via the url - http://hiphop:4247/auth.php ? location = /auth.php { # FCGI stuff or whatever PHP CGI you're using. # auth.php should return 401 or 403 when auth process fails, reby karanj - Nginx Mailing List - English
Hi, I have the following use case - I have nginx running at port 80 and a php hiphop server running at 4247. I want to achieve the following configuration - Whenever a request is received at nginx port 80, it should be sent to some auth_url (say auth.php) and if it is authorized then it should be forwarded/proxied to hiphop server running at 4247. If not some error page should be thrown.by karanj - Nginx Mailing List - English
![]() |
![]() |
![]() |
![]() |
![]() |