Heim > Fragen und Antworten > Hauptteil
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.报错如下:
Umschreibe- oder interner Umleitungszyklus bei interner Umleitung zu „/index.php“,
Client: 127.0.0.1, Server: localhost, Anfrage: „GET /favicon.ico HTTP/1.1“, Host: „ localhost:9000“, Referrer: „http://localhost:9000/“
某草草2017-05-27 17:45:48
你把第一个的 try_files
换成这样:
try_files $uri $uri/ /index.php?$query_string;
把第二个删除试试看