带参数的URL在Ngnix Server中不起作用

时间:2017-05-15 13:28:07

标签: php nginx

我在php中开发了一个小应用程序。我试图从浏览器访问我的phpfile。我正在使用Ngnix服务器。

当我点击 localhost / result.php 时,会显示回显消息。但是当我尝试在网址 localhost / result.php /?phone = 1234567890 中传递参数时,它会给出

  

404页面未找到消息。

任何遇到此问题或了解解决方案的人,请告知我们。

1 个答案:

答案 0 :(得分:0)

确保您的nginx配置与location块中的以下行类似。最后的?query_string确保它在您的请求中传递。

try_files $uri $uri/ /index.html /index.php?$query_string;
相关问题