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/"
曾经蜡笔没有小新2017-05-27 17:45:48
The prompt is that a loopback address has been formed
Remove the second location and take a look
某草草2017-05-27 17:45:48
Replace the first try_files
with this:
try_files $uri $uri/ /index.php?$query_string;
Try deleting the second one