예. 가상 호스트를 사용해야하거나 다른 포트를 듣기 위해 서버를 생성해야합니다. localhost/myporject1/
과 localhost2/myproject2
과 같은 말을하지 않는다면? 다음 서버를 가리 키도록 바로 설치가 /var/www
뿌리와 CI
server {
listen 80;
server_name localhost;
root /var/www/;
location ~ /\. {
deny all;
}
#you codigniter project
location /yourcodigniterproject {
index index.html index.php;
try_files /cache$uri @web;
}
#your other project (if usign php replicate the top with difrent directives)
location /yourotherproject {
index index.html index.php;
try_files /cache$uri $uri
}
location @web {
client_max_body_size 10M;
expires 0;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/yourcodigniterproject/index.php;
fastcgi_param PATH_INFO $fastcgi_script_name;
}
}
에 대한 FastCGI를에 경로를 조정하지만 말했듯이, 유지 관리가 훨씬 쉬워 가상 호스트를 만들 수 있습니다. 각각에 대해 sites-available
에 항목을 작성하고 (사용자가 ln -s
in
사이트 사용 가능으로 설정 함)
그런 구성이 있습니다. 하나의 가상 서버에는 사이트 코드 지정자 설정이 있고, 다른 하나는 일반 정적 웹 사이트이고, 하나는 phpmyadmin 등입니다.