suchen

Heim  >  Fragen und Antworten  >  Hauptteil

php – Laravel kann nach der Konfiguration von Nginx nicht ausgeführt werden

  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/“

天蓬老师天蓬老师2833 Tage vor858

Antworte allen(2)Ich werde antworten

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-27 17:45:48

    提示是形成了回环地址

    你把第二个location去掉看一下

    Antwort
    0
  • 某草草

    某草草2017-05-27 17:45:48

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

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

    把第二个删除试试看

    Antwort
    0
  • StornierenAntwort