내가 원하는 방식으로 내 nginx 설정을 얻는 데 문제가 있습니다. 나는/vagrant/frontend/www에 위치한 사이트 example.localhost를 가지고있다.하위 폴더에 nginx 사이트
server {
listen 80;
server_name example.localhost;
root /vagrant/frontend/www;
index index.php;
location/{
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ .*\.php$ {
include /etc/nginx/fastcgi.conf;
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
}
}
을하지만 그때 나는 주소 example.localhost/관리자에게/방랑/백엔드/www가에있는 관리자 사이트를 추가 할 : 노력이에 대한 나의 구성은 다음과 같습니다.
location /admin {
root /vagrant/backend/www;
}
location ~ /admin/.+\.php$ {
include /etc/nginx/fastcgi.conf;
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
}
오류 로그는 다음과 같습니다 : 일이 잘못, 나는 this post에 따라, 아래의 설치를 찾을 수 없습니다 (404)을받을 때이다
2014/04/23 12:30:10 [error] 15459#0: *1 "/vagrant/backend/www/admin/index.php" is not found (2: No such file or directory), client: 192.168.56.1, server: example.localhost, request: "GET /admin/ HTTP/1.1", host: "example.localhost"
내가 얻을 왜 내가 볼 404,하지만이 권리는 어떻게 얻을 수 있습니까? 어떤 도움을 많이 주시면 감사하겠습니다!
UPDATE는
나는이 내 관리자의 위치를 변경 : 이제
location ~ /admin/.+\.php$ {...}
/관리자를 example.localhost하는 전화 :
location /admin {
alias /vagrant/backend/www/;
try_files $uri $uri/ /index.php?$args;
location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
}
나는이 블록을 제거했다 올바른 처리되지만, 예를 들어 example.localhost/admin/site/index로 변경하면 프론트 엔드가 요청을 처리합니다./admin 위치가 일치하지 않는 것 같습니다 ... 어떤 생각입니까?
여기서 실제 파일은 무엇입니까? –
파일은 다음 위치에 있습니다. /vagrant/backend/www/index.php – skukje