2017-12-29 48 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; 
}