nginx and its modules configuration defined by nginx.conf and placed in the directory /usr/local/nginx/conf,/etc/nginx, or /usr/local/etc/nginx.
Directives are divided into simple directives and block directives.
If a block directive can have other directives inside braces, it is called a context (examples: events, http, server, and location).
May include several server blocks for different ports/server names
Nginx decides which server processes a request by testing uri specified in request's header, selects one with longest prefix and passes rest of uri to route
worker_processes auto;
events { }
server {
listen 8080; #default port is 80
root /data/up1; #will be used when not specified in location
location / {
}
}
server {
#proxy_passes to above server
location / {
proxy_pass http://localhost:8080;
}
}