Welcome! Log In Create A New Profile

Advanced

Re: Performance question regarding regex

July 30, 2010 03:10AM
On Thu, Jul 29, 2010 at 07:44:54PM -0400, panni wrote:

> Hey, thank you for your answer.
>
> try_files only seems to hit when a root directive is set in the config.
> try_files only works on /home/www$uri files, not on /www/html$uri
> files.
> Is this intended? How can I make it work when a file called
> /www/html/asdf.php is requested by /asdf.php?

root /;
try_files home/www$uri www/html$uri @ksphp;

but probably it's better to use:

location = /asdf.php {
fastcgi_pass ...
fastcgi_param SCRIPT_FILENAME /www/html$uri;
....
}

> location / {
> root /home/www;
> try_files $uri "/www/html$uri" @ksphp;
>
> if ($request_filename ~* \.(js|css)$) {
> return 404;
> }
>
> index index.php;
> expires 30d;
> }

Do not use "if ($request_filename":

location / {
root /home/www;
try_files $uri @ksphp;

index index.php;
expires 30d;
}

location ~* \.(js|css)$ {
return 404;
}


--
Igor Sysoev
http://sysoev.ru/en/

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

Performance question regarding regex

panni July 15, 2010 09:18PM

Re: Performance question regarding regex

panni July 15, 2010 09:24PM

Re: Performance question regarding regex

Igor Sysoev July 16, 2010 05:32AM

Re: Performance question regarding regex

panni July 29, 2010 07:44PM

Re: Performance question regarding regex

Igor Sysoev July 30, 2010 03:10AM

Re: Performance question regarding regex

panni July 30, 2010 09:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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