2017-12-29 30 views
0

これは私の既存のプロジェクトのnginx configファイルです。sms.dev/index.phpにアクセスできます。 /var/www/html/laravelフォルダーに新しいlaravelプロジェクトを展開し、このドメインをsms.dev/laravelのように使用して、新しいlaravelプロジェクトにアクセスしたいとします。 これを行う方法は?nginxエイリアスを持つ既存のPHPプロジェクトでlaravelプロジェクトを設定するには?

server{ 
     listen 80; 
     server_name sms.dev; 
     index index.php index.html index.htm; 
     root /var/www/html/sms; 
     location /laravel/ { 
      # how to config it ? 
     } 
     location ~ .*\.(php|php5)?$ 
     { 
       fastcgi_pass 127.0.0.1:9000; 
       fastcgi_index index.php; 
       include fcgi.conf; 
     } 

     if (!-e $request_filename) { 
       return 404; 
     } 
} 
+1

参照[この答え]内try_files $uri $uri/ /index.php?$query_string;を追加してみてください(https://stackoverflow.com/questions/45287201/wordpress-laravel-and-nginx/45297857#45297857) 。 –

+0

ブラウザは私がアクセスするものを何でも404返します。 – macc

答えて

0

お住まいの地域ブロック

location /laravel/ { 
    try_files $uri $uri/ /index.php?$query_string; 
} 
関連する問題