Forum: NGINX nginx-0.7.40

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Igor S. (Guest)
on 2009-03-09 11:12
(Received via mailing list)
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;
    }
}
Dave C. (Guest)
on 2009-03-09 11:48
(Received via mailing list)
Igor, that is awesome. Thanks!

Cheers

Dave
Mathew D. (Guest)
on 2009-03-09 18:02
(Received via mailing list)
Brilliant feature.
Kon W. (Guest)
on 2009-03-09 18:26
(Received via mailing list)
Awesome!

On Mon, Mar 9, 2009 at 8:51 AM, Mathew D.
郭振立 (Guest)
on 2009-03-10 08:14
(Received via mailing list)
Nice work!



Thanks a lot.
This topic is locked and can not be replied to.