当前位置: > Linux服务器 > nginx >

nginx配置文件nginx.conf解读

时间:2016-10-21 21:32来源:linux.it.net.cn 作者:IT
server {
    listen 8080;
    root /data/up1;

    location / {
    }
}

This will be a simple server that listens on the port 8080 (previously, the listen directive has not been specified since the standard port 80 was used) and maps all requests to the /data/up1directory on the local file system. Create this directory and put the index.html file into it. Note that the root directive is placed in the server context. Such root directive is used when the location block selected for serving a request does not include own root directive.

 

nginx selects a location block to serve a request it first checks location directives that specify prefixes, remembering location with the longest prefix, and then checks regular expressions. If there is a match with a regular expression, nginx picks this location or, otherwise, (it picks the one remembered earlier)???

(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容