---
title: "nginx alias与root的区别"
author: "chembo"
date: "2011-10-13T12:05:49Z"
tags: ["alias", "nginx", "root"]
categories: ["开源软件"]
slug: "nginx-alias-root"
draft: false
lastmod: "2011-10-13T12:05:49Z"
id: 1194292
url: "https://chembo.iteye.com/blog/1194292"
---

看例子：
1.      location ~ ^/awstats/ {
        root  /home/awstats/;
访问：http://test.com/awstats/ 实际访问的是/home/awstats/awstats/
 
2.      location ~ ^/awstats/ {
        alias  /home/
访问：http://test.com/awstats/ 实际访问的是/home/