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/up1
directory 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)???