ngixn配置
server {
listen 9000;
server_name localhost ;
root "/Applications/MAMP/htdocs/xx/xx/xx/public";
location / {
try_files \$uri \$uri/ /index.php?\$query_string;
index index.html index.htm index.php;
#autoindex on;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
}
2.报错如下:
rewrite or internal redirection cycle while internally redirecting to "/index.php",
client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:9000", referrer: "http://localhost:9000/"
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
提示是形成了回环地址
你把第二个location去掉看一下
你把第一个的
try_files换成这样:把第二个删除试试看