php – Laravel kann nach der Konfiguration von Nginx nicht ausgeführt werden
天蓬老师
天蓬老师 2017-05-27 17:43:48
0
2
905
  1. 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/“

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

Antworte allen(2)
曾经蜡笔没有小新

提示是形成了回环地址

你把第二个location去掉看一下

某草草

你把第一个的 try_files 换成这样:

try_files $uri $uri/ /index.php?$query_string;

把第二个删除试试看

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage