Captures in regex locations

The patch against 0.7.39 to support

  1. captures in regex location

  2. an “alias” inside these locations

    location ~* ^/files/(.+.(?:gif|jpe?g|png))$ {

    alias   /path/to/$1;
    

    }

  3. captures became global and may be used as variables in some
    directives:

    location ~* ^/files/(.+.(?:gif|jpe?g|png))$ {

    error_page  404  /index.php?img=$1;
    

    }

Igor,

This is awesome, and I look forward to playing with it. I assume this
is
presented as a patch for testing but is planned to be released at some
point
later, correct? Regardless, keep up the great work!

  • Merlin

On Wed, Mar 04, 2009 at 01:34:35PM -0800, Merlin wrote:

Igor,

This is awesome, and I look forward to playing with it. I assume this is
presented as a patch for testing but is planned to be released at some point
later, correct? Regardless, keep up the great work!

Yes, I plan to include t in 0.7.40.

On Thu, 5 Mar 2009 00:40:58 +0300
Igor S. [email protected] wrote:

On Wed, Mar 04, 2009 at 01:34:35PM -0800, Merlin wrote:

Igor,

This is awesome, and I look forward to playing with it. I assume
this is presented as a patch for testing but is planned to be
released at some point later, correct? Regardless, keep up the
great work!

Yes, I plan to include t in 0.7.40.

This is great news, this feature will make some of my Nginx config
files a lot simpler!

Thanks Igor!

On Wed, Mar 04, 2009 at 11:00:48PM +0100, Adrian P. de Castro wrote:

great work!

Yes, I plan to include t in 0.7.40.

This is great news, this feature will make some of my Nginx config
files a lot simpler!

Probably to simplfy configuration even more I will make the “match”
directive

match  $http_destination  ^https?(:.+)$;

proxy_set_header   Destination     http$1;

as replacement to

set  $destination  $http_destination;

if ($http_destination ~* ^https(.+)$) {
    set  $destination  $http$1;
}

proxy_set_header   Destination     $destination;