2. NGINX, Inc.
• Summer 2011, Moscow office
• Fall 2011, company and Series A round announced in
San Francisco. First commercial customer: Netflix
• Summer 2013, NGINX+ release
• Spring 2014, first nginx summit held in San Francisco
• Fall 2014, nginx.conf/2014 in San Francisco
2
3. NGINX, Inc.
• Head office: San Francisco
16 people, sales, business development, marketing,
pre-sales, product management
!
• Engineering office: Moscow
17 people, software development, support and
professional service (we are hiring!)
3
4. Products
• nginx f/oss
• paid support and professional services available
!
• NGINX+
• closed source, binary only
• advanced load balancing
• monitoring and configuration
• video streaming
!
See nginx.com for more
4
7. Apache: add more fun
• global server
• <VirtualHost>
• <Directory> and <DirectoryMatch>
• <Files> and <FilesMatch>
• <Location> and <LocationMatch>
7
8. Apache: add more fun
• global server
• <VirtualHost>
• <Directory> and <DirectoryMatch>
• <Files> and <FilesMatch>
• <Location> and <LocationMatch>
• .htaccess files spread all over site structure
8
9. Apache: add more fun
• global server
• <VirtualHost>
• <Directory> and <DirectoryMatch>
• <Files> and <FilesMatch>
• <Location> and <LocationMatch>
• .htaccess files spread all over site structure
AccessFileName .hide-and-seek
9
10. Apache: add more fun
• global server
• <VirtualHost>
• <Directory> and <DirectoryMatch>
• <Files> and <FilesMatch>
• <Location> and <LocationMatch>
• .htaccess files spread all over site structure
AccessFileName .hide-and-seek
• RewriteRules
10
11. nginx: order does not matter
GET /script/
!
location / {
index index.html;
}
!
location /script/ {
index index.php;
}
!
/script/index.php
GET /script/
!
location /script/>
index index.php;
}
!
location / {
index index.html;
}
!
/script/index.php
11
30. “if” is Evil
if (true) {
gzip off;
}
!
if (true) {
etag off;
}
30
31. Use “if” only to return HTTP code
if ($bot) {
return 200 “No bots here!”;
}
31
32. TL;DR
• only prefix locations, avoid regular expression locations
• isolate regular expressions
• regular expression in maps
• duplication is your friend
• no rewrites
• use ”if” only to return HTTP code
32