Welcome! Log In Create A New Profile

Advanced

Re: custom 404 nginx + php-fpm

July 30, 2009 02:28PM
On Thu, Jul 30, 2009 at 02:04:43PM -0400, shaktale wrote:

>
> Probably yuo need somthing like this:
>
> location ~ ^.+\.(js|jpe?g|gif|png|css)$ {
> try_files $uri /index.php;
> expires 1d;
> }
>
> loaction ~ ^/(.+)_(.+)/(.+)/$ {
> fastcgi_pass 127.0.0.1:9000;
> include /usr/local/nginx/conf/fastcgi_params;
> fastcgi_param SCRIPT_FILENAME /path/to/index.php;
> fastcgi_param SCRIPT_NAME /index.php;
> fastcgi_param PATH_INFO /action1/$1/action2/$2/action3/$3;
> }
>
> location ~ ^(/.+_.+/.+)([^/])$ {
> rewrite ^(/.+_.+/.+)([^/])$ $1$2/ permanent;
> }
>
> location ~ ^.+\.php$ {
> try_files $uri /index.php?$args;
>
> fastcgi_pass 127.0.0.1:9000;
> include /usr/local/nginx/conf/fastcgi_params;
> fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
> fastcgi_param SCRIPT_NAME $fastcgi_script_name;
> }
>
> location / {
> try_files $uri /index.php?$args;
> }
>
>
> This works fine, thank you.
>
> Is there any difference (in performance or so) if I do:
>
>
> location / {
> rewrite ^(/.+_.+/.+)([^/])$ $1$2/ permanent;
> try_files $uri /index.php?$args;
> }
>
>
>
> instead of:
>
>
> location ~ ^(/.+_.+/.+)([^/])$ {
> rewrite ^(/.+_.+/.+)([^/])$ $1$2/ permanent;
> }
>
>
> Thanks again.

In this case probably. Your variant may be even faster: one regex instead
of two.


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

custom 404 nginx + php-fpm

shaktale July 29, 2009 04:49AM

Re: custom 404 nginx + php-fpm

Igor Sysoev July 29, 2009 05:06AM

Re: custom 404 nginx + php-fpm

shaktale July 30, 2009 02:04PM

Re: custom 404 nginx + php-fpm

Igor Sysoev July 30, 2009 02:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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