nginx重写规则捕获的内容超出了其应有的范围

nginx重写规则捕获的内容超出了其应有的范围,nginx,rewrite,Nginx,Rewrite,我设置了一个重写规则,如下所示: rewrite ^(www\.)*mysite\.com(/)*(index\.php)*$ /texts/mysite.com_page_24.html last; 它应该只捕捉以下呼叫: www.mysite.com www.mysite.com/ mysite.com mysite.com/ www.mysite.com/index.php mysite.com/index.php?option=com_correct&task=view&am

我设置了一个重写规则,如下所示:

rewrite ^(www\.)*mysite\.com(/)*(index\.php)*$ /texts/mysite.com_page_24.html last;
它应该只捕捉以下呼叫:

www.mysite.com
www.mysite.com/
mysite.com
mysite.com/
www.mysite.com/index.php
mysite.com/index.php?option=com_correct&task=view&id=5&Itemid=30
但它也捕捉到诸如以下呼叫:

www.mysite.com
www.mysite.com/
mysite.com
mysite.com/
www.mysite.com/index.php
mysite.com/index.php?option=com_correct&task=view&id=5&Itemid=30
为什么我会有这种奇怪的行为?
^
$
标志清楚地指示开始和结束

编辑:

当请求我不想捕获的内部链接时,查看日志文件会给出:

"GET /mysite.com/index.php?option=com_correct&task=view&id=5&Itemid=30 HTTP/1.0" 200 118 "-" "-"

经过进一步调查,nginx似乎在回避这些争论,并表现得好像它是同一个页面。如何将nginx设置为不回避这些参数,并将它们视为不同的页面

是的,正如您已经发现的,重写不会影响查询字符串,您需要处理
$args
字符串,简单的方法是将您的重写放入一个条件中,如果条件表明args为空,请尝试以下操作

if ( $args = "" ) {
    # your rewrite
}