Rewrite all urls inside location block in nginx

howard chen howachen at gmail.com
Mon Dec 24 10:01:11 UTC 2012


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20121224/1a4c07a1/attachment.html>


More information about the nginx mailing list