Forum: NGINX captures in regex locations

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-04 23:17
(Received via mailing list)
Attachment: patch.location_captures (0 Bytes)
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;
   }
Merlin (Guest)
on 2009-03-04 23:45
(Received via mailing list)
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
Igor S. (Guest)
on 2009-03-04 23:58
(Received via mailing list)
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.
Adrian P. de Castro (Guest)
on 2009-03-05 00:09
(Received via mailing list)
On Thu, 5 Mar 2009 00:40:58 +0300
Igor S. <removed_email_address@domain.invalid> 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!
Igor S. (Guest)
on 2009-03-05 00:31
(Received via mailing list)
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;
This topic is locked and can not be replied to.