err_too_many_redirects nginx when using rewrite rule for removing slash from url
<p>My problem is connected with the next situation: when I`m trying to add a rule to remove slash from the url, I see the next error code "err_too_many_redirects"(if I try to check that such kind of links like site.com/images/ or other directory link return 403 code )</p>

<pre><code>location / {
        try_files $uri $uri/ /index.php?$query_string;
        rewrite ^/(.*)/$ /$1 permanent;#remove slash
}
</code></pre>

<p>Could anyone help me to find soultion for this problem? </p>

<p>Site is working on nginx + php-fpm.</p>