Segfault in 1.0.5.

António P. P. Almeida appa at perusio.net
Sat Jul 23 14:42:50 UTC 2011


On 23 Jul 2011 15h09 WEST, gmm at csdoc.com wrote:

>
> sorry, all my previous messages in this thread was with errors.
>
> Igor, likely nginx now need something like httpd mod_macro
> to eliminate multiple duplicates of small config fragments

Hello Gena,

I followed the discussion on the russian ML. Yes something like your
use suggestion would be great.

> On 23.07.2011 12:20, Igor Sysoev wrote:
>
>> location / {
>> expires 30d;
>> error_page 404 = @joomla;
>> log_not_found off;
>> }
>>
>> location ~ ^/(images|cache|media)/ {
>> # static
>> }
>
> probably, this is most correct and most performance-optimized,
> (both - server-side and client-side) fragment of nginx config:
>
> -          location ~ ^/(images|cache|media)/ {
> -                  # static
> -          }
>
> +          location ^~ /images/ {
> +                # static
> +                expires 30d;
> +                error_page 404 = @joomla;
> +                log_not_found off;
> +          }
> +
> +          location ^~ /cache/ {
> +                # static
> +                expires 30d;
> +                error_page 404 = @joomla;
> +                log_not_found off;
> +          }
> +
> +          location ^~ /media/ {
> +                # static
> +                expires 30d;
> +                error_page 404 = @joomla;
> +                log_not_found off;
> +          }
> +

Wouldn't the use of try_files be preferable to error_page?

-                error_page 404 = @joomla;
+                try_files $uri $uri/ @joomla;

From the little I know, try_files does a stat() call while error_page
is a special response. They both do an internal redirection. They run
on different phases. Is this correct? If so is there any rule of thumb
for deciding when to use try_files vs. error_page 404.

Thanks,
--- appa




More information about the nginx-devel mailing list