Nginx Essentials

Nginx Essentials

Language: English

Pages: 150

ISBN: 1785289535

Format: PDF / Kindle (mobi) / ePub


Excel in Nginx quickly by learning to use its most essential features in real-life applications

About This Book

  • Learn how to set up, configure, and operate an Nginx installation for day-to-day use
  • Explore the vast features of Nginx to manage it like a pro, and use them successfully to run your website
  • Example-based guide to get the best out of Nginx to reduce resource usage footprint

Who This Book Is For

This book is ideal for skilled web masters and site reliability engineers who want to switch to Nginx or solidify their knowledge of Nginx. Knowledge of Unix and webmaster skills are required.

What You Will Learn

  • Get started with an Nginx installation from scratch in various environments and customize it for your purposes
  • Start and stop a basic Nginx installation, discover the basics of process management, and learn how to set up Nginx to serve static data
  • Create highly-maintainable configuration files to perform the most critical Nginx maintenance tasks
  • Set up Nginx as a reverse proxy and learn to use the Nginx caching feature
  • Discover how to benefit from the Nginx rewrite engine and how to use access restrictions in Nginx
  • Use various Nginx features to manage inbound traffic and understand how to use Nginx load balancing and fault tolerance features
  • Understand advanced feature-independent performance tuning strategies and optimizations
  • Manage inbound and outbound traffic and configure access control

In Detail

Nginx is an open source and cross-platform reverse proxy server designed for low memory usage and high performance and concurrency.

This book provides both basic and in-depth knowledge to help you effectively solve challenges with Nginx, or comfortably go through a transition period when switching to Nginx.

Starting with the basics, you will learn by example how to set up, configure, and operate an Nginx installation and use features of Nginx to elegantly solve challenges you experience every day when running your website. You will learn to use the rewrite engine to solve day-to-day tasks and be able to configure access restrictions in Nginx. You will also be able to manage inbound traffic using a number of Nginx features and use Nginx for load balancing and fault-tolerance features. Finally, you will learn how to solve common performance problems and apply a number of performance-tuning strategies.

Through easy exploration of the most intricate topics, this book aims to bring you to the next level in your Nginx experience.

 

 

 

 

 

 

 

 

 

 

 

 

attacker. Nginx has an elegant solution for this problem in the form of the try_files directive. The try_files directive takes a list of files and a location as the last argument. Nginx tries specified files in consecutive order and if none of them exists, it makes an internal redirect to the specified location. Consider the following example: location / { try_files $uri $uri/ @proxy; } location @proxy { proxy_pass http://backend; } The preceding configuration first looks up a file

until either the cache item is populated or the lock timeout expires. The lock timeout can be specified using the proxy_cache_lock_directive directive. If higher availability of the cache is required, you can configure Nginx to reply with stale data when a request refers to a cached item. This is very useful when Nginx acts as an edge server in a distribution network. The users and search engine crawlers will see your web site available, even though the main site experiences connectivity

jpg; application/x-javascript js; application/atom+xml atom; application/rss+xml rss; } Any command-line input or output is written as follows: # cp /usr/local/nginx/nginx.conf.default /etc/nginx/nginx.conf New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Clicking the Next button moves you to the next screen." Note Warnings or important notes appear in a box like this. Tip Tips and

Distribution-specific startup scriptsusing / Distribution-specific startup scripts E EPEL wikiURL / Installing Nginx on Red Hat Enterprise Linux or CentOS/Scientific Linux Extra Packages for Enterprise Linux (EPEL)about / Installing Nginx on Red Hat Enterprise Linux or CentOS/Scientific LinuxURL / Installing Nginx on Red Hat Enterprise Linux or CentOS/Scientific Linuxenabling / Installing Nginx on Red Hat Enterprise Linux or CentOS/Scientific Linux F Filesystem Hierarchy Standard (FHS)about /

use, be prepared to sort out challenges such as dependency maintenance, distribution, and application of security patches. In this section, we will be referring to the configuration script. Configuration script is a shell script similar to one generated by autoconf, which is required to properly configure the Nginx source code before it can be compiled. This configuration script has nothing to do with the Nginx configuration file that we will be discussing later. Downloading the Nginx source

Download sample

Download