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=/;
}
}
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/"
The prompt is that a loopback address has been formed
Remove the second location and take a look
Replace the first
try_files
with this:Try deleting the second one