Mastering Nginx

(Ron) #1
Chapter 8

[ 207 ]

This can lead to configuration errors when new locations are added, and the directives


are not copied to those new locations or are copied incorrectly. The point of using the
root and index directives is to indicate the document root for the virtual server and


the files that should be tried when a directory is given in the URI, respectively. These
values are then inherited for any location within that server context.


server {

server_name http://www.example.com;

root /var/www/html;

index index.php index.html index.htm;

location / {

}

location /ftp{

}

}

Here, we have specified that all files will be found under /var/www/html and
that index.php index.html index.htm are to be tried, in order, as index files


for any location.


Operating system limits


The operating system is often the last place we look to for discovering a problem.
We assume that whoever set up the system has tuned the operating system for


our workload and tested it under similar scenarios. This is often not the case.
We sometimes need to look into the operating system itself to identify a bottleneck.


As with NGINX, there are two major areas where we can initially look for performance
problems: file descriptor limits and network limits.

Free download pdf