A path to the file is constructed by merely adding a URI to the value of the root directive. If a URI has to be modified, the alias directive should be used

Syntax: alias path;
Default:
Context: location

Defines a replacement for the specified location. For example, with the following configuration

location /i/ {
alias /data/w3/images/;
}

on request of “/i/top.gif”, the file /data/w3/images/top.gif will be sent.

The path value can contain variables, except $document_root and $realpath_root.

If alias is used inside a location defined with a regular expression then such regular expression should contain captures and alias should refer to these captures (0.7.40), for example:

location ~ ^/users/(.+\.(?:gif|jpe?g|png))$ {
alias /data/w3/images/$1;
}

When location matches the last part of the directive’s value:

location /images/ {
alias /data/w3/images/;
}

it is better to use the root directive instead:

location /images/ {
root /data/w3;
}

最新文章

  1. 关于Three.js基本几何形状之SphereGeometry球体学习
  2. C#中的Json的序列化和反序列化
  3. js的一点
  4. October 12th 2016 Week 42nd Wednesday
  5. ACM2033
  6. OutputCache各参数的说明
  7. Mybatis Dynamic Query 2.0 入门
  8. NODE_ENV 不是内部或外部命令,也不是可运行的程序,或者批处理文件
  9. [Linux]ubuntu安装基本流程
  10. python之psutil模块详解(Linux)--小白博客
  11. mysql case when then else end 写法
  12. MATLAB数据类型
  13. [Linux]Shell的运算符和特殊变量
  14. B树就想到这个
  15. python OCR 图形识别
  16. rtmp一些状态信息详解-as连接FMS服务器报错状态汇总~~
  17. Visual C++编程实现摄像头视频捕捉
  18. VIM基本命令及自用配置
  19. bzoj 3907 网格 bzoj2822 [AHOI2012]树屋阶梯——卡特兰数(阶乘高精度模板)
  20. (转)基于Metronic的Bootstrap开发框架经验总结(9)--实现Web页面内容的打印预览和保存操作

热门文章

  1. iOS开发常用函数
  2. Java Web中涉及的编解码
  3. Java反射拾遗
  4. 传统javabean与spring中的bean的区别
  5. ASP.NET MVC 简单分页代码
  6. PHP生成缩略图(3)--封装类
  7. springboot中使用自定义的properties属性
  8. <VS2010>混合模式程序集是针对“v2.0”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集
  9. python之函数的参数
  10. 记录下使用iis7代理node.js写的网站程序