Welcome! Log In Create A New Profile

Advanced

error_page VS !-e directive

Posted by kslimani 
error_page VS !-e directive
June 07, 2010 08:01AM
Hello,

does someone know which of these two methods is faster to process for Nginx for handle non-existing files :
(we suppose index.php will handle 404 errors)

[b]First one with -e directive :[/b]

[code]
if (!-e $request_filename) {
rewrite ^(.*) /index.php last;
}
[/code]

[b]Second one using error_page and @ :[/b]

[code]
error_page 404 = @foo

location @foo {
rewrite ^(.*) /index.php last;
}
[/code]

Thank you.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 198
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready