사용자 도구

사이트 도구


nginx:location

문서의 이전 판입니다!


nginx location 설정

alias와 root의 차이

alias 는 특정 URL이 서빙할 파일 경로를 변경하는 역할을 한다. root와는 역할이 다르다.

location /images/something/ {
    alias /var/www/something/
}

이 상태에서 http://example.com/images/something/somepath/myfile.png의 실제 파일상 경로는 /var/www/something/sompath/myfile.png가 된다. 중간에 location에 기술된 /images/something은 경로를 구성할 때 빠진다.

반면에 root /var/www/something 으로 구성했다면 실제 파일상 경로는 /var/www/something/images/something/somepath/myfile.png가 된다.

nginx/location.1352277687.txt.gz · 마지막으로 수정됨: 2012/11/07 17:41 저자 kwon37xi