nginx 0.7.40

Changes with nginx 0.7.40                                        09 Mar 2009

   *) Feature: the "location" directive supports captures in regular
      expressions.

   *) Feature: an "alias" directive with capture references may be used
      inside a location given by a regular expression with captures.

   *) Feature: the "server_name" directive supports captures in regular
      expressions.

   *) Workaround: the ngx_http_autoindex_module did not show the trailing
      slash in directories on XFS filesystem; the issue had appeared in
      0.7.15.
      Thanks to Dmitry Kuzmenko.

Examples, alias:

   location ~ ^/users/(.+\.(?:gif|jpe?g|png)

)$ {
       alias  /data/w3/images/$1;
   }


server_name:

server {
   server_name   ~^(www\.)?(.+)$;

   location / {
       root  /sites/$2;
   }
}

server {
   server_name   _; # nonexistent name

   location / {
       root  /sites/default;
   }
}

你可能感兴趣的:(nginx)