十三周二次课(5月3日、4日)复习LNMP扩展nginx中的root和alias区别 http://blog.csdn.net/21aspnet/article/details/6583335 nginx的alias和root配置 http://www.ttlsa.com/nginx/nginx-root_alias-file-path-configuration/h
分类:
系统相关 时间:
2018-05-06 23:57:31
阅读次数:
239
以前只知道Nginx的location块中的root用法,用起来总是感觉满足不了自己的一些想法。然后终于发现了alias这个东西。 先看toot的用法 这样配置的结果就是当客户端请求 /request_path/image/cat.png 的时候, Nginx把请求映射为/local_path/im ...
分类:
其他好文 时间:
2018-04-21 00:24:52
阅读次数:
176
先看官方文档http://nginx.org/en/docs/http/ngx_http_core_module.html#alias
http://nginx.org/en/docs/http/ngx_http_core_module.html#root先看toot的用法location?/request_path/image/?{
???&nb
分类:
其他好文 时间:
2018-03-27 12:25:56
阅读次数:
136
例如请求/touch/article/北京/full.html,到达nginx后变成//touch/article/%E5%8C%97%E4%BA%AC/full.html,Nginx静态文件配置:location~*^/touch/article/.*\.html${expires-1;root/home/htmlfile;charsetUTF-8;if(!-f$request_filename){proxy_passhttp://client.api.com;}}..
分类:
Web程序 时间:
2016-10-25 03:37:11
阅读次数:
359
问题:假如www.111.com站点的root目录为/data/web/,现在想在www.111.com下放一个站点,www.111.com/abc/但不能直接在/data/web/下创建abc目录,要放在/data1/abc/下。解决办法:使用nginx的alias功能实现虚拟目录在配置文件中加入location~/abc/(.*)${alias/data1/abc/$1;}当..
分类:
Web程序 时间:
2016-07-16 07:08:51
阅读次数:
164