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