2016-10-27 4 views
0

나는 초심자이며 NGINX에서 mod 재 작성에 문제가있다.NGINX Mod_rewrite, 하위 폴더

나는 당신에게 environement을 제공 : 내가 2 응용 프로그램이 있습니다

  • 각각 www /에서
  • 다른 WWW/ATRI/

모두 응용 프로그램을 mod_rewrite를해야하므로 나는 이것을 사용한다 :

location/{ 
try_files $uri $uri/ /index.php?$args; 
} 

이 앱은 완전히 처음 앱을 위해 작동하지만, 두 번째 app/atri /에 폴더/www /에있는 첫 번째 앱의 루트와 같은 모든 앱을로드합니다. conf에 2 개의 앱을 분리 할 생각이 있습니까?

정보에 대해서는 codeigniter를 사용합니다.

답장을 보내 주셔서 감사합니다.

답변

0

시도 :

location/{ 
    try_files $uri $uri/ /index.php?$args; 
} 
location /atri { 
    try_files $uri $uri/ /atri/index.php?$args; 
} 

그 이상을 this document를 참조하십시오.

+0

답장을 보내 주셔서 감사합니다. nginx를 다시 시작해보십시오.하지만 같은 문제가 발생했습니다 ... – Trololinlo

0
location /atri/ { 
alias /var/www/html/atri/; 
try_files $uri $uri/ /atri/index.php; 

location ~ \.php$ { 
    fastcgi_split_path_info ^(.+\.php)(/.+)$; 
    fastcgi_index index.php; 
    fastcgi_pass unix:/run/php/php7.0-fpm.sock; 
    include /etc/nginx/fastcgi_params; 
    fastcgi_param SCRIPT_FILENAME $request_filename; 
} 

}

이 시도!