Request for a "no capture" rewrite directive enhancement

B.R. reallfqq-nginx at yahoo.fr
Wed May 28 04:02:42 UTC 2014


What about:

location ~ "^/[a-f0-9]{16}/(css|js)/(.+)" {

	expires 30d;
	return $scheme://$host/$1/$2? break;
}

?

You could add the 301 code for permanent redirect, see
http://nginx.org/r/return
---
*B. R.*


On Wed, May 28, 2014 at 1:52 AM, Peter Mescalchin <
peter.mescalchin at gmail.com> wrote:

> Hello Nginx developers,
>
>    speaking to Maxim Konovalov over Twitter, suggested this would be the
> better place to get an answer to my suggestion.
>
> Basically what I would like to see is the ability to use a rewrite
> directive without the need to capture the current URI, which in turn
> overwrites $1,$2,$x captures made within a location directive.
>
> Best to explain via an example:
>
> https://gist.github.com/magnetikonline/11364574
>
>
> As you can see, this works (and works well) but the need to use "set" to
> save copies of $1/$2 seems a little wasteful.
>
> Digging through the documentation I can't seem to find a way of using
> rewrite without blowing away/not capturing the current URI.
>
>
> Thoughts?
>
>    Pete
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140528/0853a7b8/attachment.html>


More information about the nginx mailing list