Help with my config

As soon as I add the expires section (at the bottom) accel-redirect
for images stops working.

Is it apparent why?

My config:

http://pastie.caboo.se/151398

Thanks,
Alex

How does this look?

I updated the ‘^~’ to my location, but I moved the expires to a
different section.

How’s this config?

Alex

Here’s the link:

http://pastie.caboo.se/151627

On Wed, Feb 13, 2008 at 10:22:10AM -0800, Alex E. wrote:

Here’s the link:

Parked at Loopia

I prefer this configuration:

server {

 ...

 root /u/apps/asdf/current/public;

 if (-f $document_root/system/maintenance.html) {
     rewrite  ^(.*)$  /system/maintenance.html last;
 }

 if (-f $request_filename.html) {
     rewrite (.*) $1.html   last;
 }

 location / {
     index   index.html;
     error_page   404 = @mongrel;
 }

 location @monrgel {
     proxy_pass  http://monrgel;
     proxy_set_header   ...
     ...
 }

 location ^~ /accounts {
     internal;
     root /u/apps/asdf/shared;
 }

 location ~* \.(js|css|jpg|jpeg|gif|png|swf)$ {
     expires      1M;
 }

 error_page   500 502 503 504  /500.html;
 location = /500.html {
      root   /u/apps/asdf/current/public;
 }

On Tue, Feb 12, 2008 at 10:48:52PM -0800, Alex E. wrote:

As soon as I add the expires section (at the bottom) accel-redirect
for images stops working.

Is it apparent why?

My config:

Parked at Loopia

I have tired of this “if (-f $request_filename)” pattern.
This became the same ugly pattern as Apache’s Auth directives usage in
.htaccess only and lot of RewriteRule’s to compencate inability
of PHP programmers to work with URIs different from /index.php.

You should use ^~ in “location ^~ /accounts”:

location ^~ /accounts {
    internal;
    root /u/apps/asdf/shared;
}

And remove the useless “if (-f $request_filename)” in static location:

location ~* \.(js|css|jpg|jpeg|gif|png|swf)$ {
    expires      1M;
}