Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Re: Rewrite all urls inside location block in nginx

$
0
0
On Mon, Dec 24, 2012 at 5:01 PM, howard chen <howachen@gmail.com> wrote:
>
> Hello,
>
> I have a config like
> location = /foo.xml { if ($scheme = https) { rewrite .*
> http://$http_host/foo.xml permanent; } }
>
> But as you can see, the file is already matched with the location block,
> it seems to me the regex rewrite is wasting the CPU cycle, are there any
> better way to do it?
>

return 301 http://$http_host/foo.xml;

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>