Chapter
Chapter 1: Downloading and
Installing Nginx
Setting up the prerequisites
The GNU Compiler Collection
Downloading and extracting
Modules enabled by default
Modules disabled by default
Regular HTTP and HTTPS servers
Build configuration issues
Make sure you installed the prerequisites
Directories exist and must be writable
Compiling and installing the program
Controlling the Nginx service
Nginx command-line switches
Starting and stopping the daemon
Testing the configuration
Adding Nginx as a system service
The init script for Debian-based distributions
The init script for Red Hat–based distributions
Debian-based distributions
Red Hat–based distributions
Chapter 2: Basic Nginx Configuration
Configuration file syntax
Organization and inclusions
Directives accept specific syntaxes
Diminutives in directive values
The Nginx process architecture
Upgrading Nginx gracefully
Chapter 3: HTTP Configuration
Socket and host configuration
server_names_hash_max_size
server_names_hash_bucket_size
reset_timedout_connection
client_body_in_single_buffer
client_header_buffer_size
large_client_header_buffers
chunked_transfer_encoding
File processing and caching
variables_hash_bucket_size
Search order and priority
Chapter 4: Module Configuration
Reminder on regular expressions
Module directives and variables
Website access and logging
Setting up an SSL certificate
Other miscellaneous modules
Chapter 5: PHP and Python with Nginx
An introduction to FastCGI
Understanding the CGI mechanism
The Common Gateway Interface
Fast Common Gateway Interface
FastCGI caching and buffering
Setting up PHP and PHP-FPM
Downloading and extracting
Post-install configuration
Setting up Python and Django
Starting the FastCGI process manager
Chapter 6: Apache and Nginx Together
The reverse proxy mechanism
Advantages and disadvantages of the mechanism
Caching, buffering, and temporary files
Limits, timeouts, and errors
Configuring Apache and Nginx
Resetting the port number
Accepting local requests only
Improving the reverse proxy architecture
Forwarding the correct IP address
Server control panel issues
Chapter 7: From Apache to Nginx
Flexibility and community
Porting your Apache configuration
Virtual hosts and configuration sections
A recap on Apache .htaccess files
Chapter 8: Introducing Load Balancing and Optimization
An introduction to load balancing
Understanding the concept of load balancing
Request distribution mechanisms
Using Nginx as a TCP load balancer
An example of MySQL load balancing
Thread pools and I/O mechanisms
Relieving worker processes
AIO, Sendfile, and DirectIO
Deploying a WordPress site
Preparing your server and obtaining WordPress
Downloading and extracting WordPress
Securing communications with HTTPS
Self-signed certificates and certificate authorities
Obtaining your SSL certificate
Enabling HTTPS in your Nginx configuration
Setting up and testing SPDY
Creating your ownCloud drive
Setting up a self-signed certificate
Chapter 10: Troubleshooting
General tips on troubleshooting
Checking access permissions
Testing your configuration
Have you reloaded the service?
The 403 Forbidden custom error page
Truncated or invalid FastCGI responses
Location block priorities