nginx的alias的用法及和root的区别
http://nginx.org/en/docs/http/ngx_http_core_module.html#alias
http://nginx.org/en/docs/http/ngx_http_core_module.html#root
以前只知道nginx的location块中的root用法,用起来总是感觉满足不了自己的一些想法。然后终于发现了alias这个东西。
先看toot的用法
location /request_path/image/ { root /local_path/image/;}
这样配置的结果就是当客户端请求 /request-path/image/cat.png 的时候,
nginx把请求映射为/local_path/image/request-path/image/cat.png
再看alias的用法
location /request_path/image/ { alias /local_path/image/;}
这时候,当客户端请求 /request-path/image/cat.png 的时候,
nginx把请求映射为/local_path/image/cat.png
对比root就可以知道怎么用了吧~~ :)
').addclass('pre-numbering').hide(); $(this).addclass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadein(1700); }); }); 以上就介绍了nginx的alias的用法及和root的区别,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。