need help calling PHP as a fallback

Edho P Arief edhoprima at gmail.com
Tue Jan 5 12:23:37 MSK 2010


On Tue, Jan 5, 2010 at 3:15 PM, davvv <nginx-forum at nginx.us> wrote:
> Oops, sorry about that; I thought you meant to simply add "debug" to the log directive in the .conf.
>
> But! I updated to 0.8.31 and rebuilt with --with-debug (as per your recommendation) and everything works perfectly.
>
> Here's my final nginx.conf if anyone else will want to do something similar in the future.
>
>        location /eve/ {
>            proxy_pass http://127.0.0.1:9001;
>            proxy_intercept_errors on;
>            error_page 504 = @fallback;
>        }
>
>        location @fallback {
>              rewrite  ^(.*)$  /backend.php;
>        }
>
> Kind of a messy rewrite, but for my purposes, it's fine. Thanks for all the help, and happy 2010 =)
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,36944,36998#msg-36998
>
>

I believe you can just do this

       location /eve/ {
           proxy_pass http://127.0.0.1:9001;
           proxy_intercept_errors on;
           error_page 504 = /backend.php;
       }

-- 
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



More information about the nginx mailing list