Nginx HTTP Server
eBook - ePub

Nginx HTTP Server

  1. 348 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Nginx HTTP Server

About this book

In Detail

Nginx is a lightweight HTTP server designed for high-traffic websites, with network scalability as primary objective. With the advent of high-speed Internet access, short loading times and fast transfer rates have become a necessity. This free open-source solution will either serve as full replacement of other software such as Apache, or stand in front of your existing infrastructure to improve its overall speed. However, migrating to Nginx requires some guidance.

This book serves as a detailed guide to setting up Nginx in different production situations: as standalone server, as reverse proxy, interacting with applications via FastCGI, and more. In addition, the complete directive reference will be your best friend at all stages of the configuration and maintenance processes.

This book is the perfect companion for both Nginx beginners and experienced administrators. For the former, it will take you through the complete process of setting up this lightweight HTTP server on your system and configuring its various modules to get it to do exactly what you need, in a fast and secure way. For the latter, it provides different angles of approach that can help you make the most of your current infrastructure. As the book progresses, it provides a complete reference to all the modules and directives of Nginx. It will explain how to replace your existing server with Nginx or configure Nginx to work as a frontend for your existing server.

By the end of this book, you will be geared up to implement Nginx as a web server that will boost the speed of all your web applications.

A handy guide to setting up Nginx as a standalone web server or as a reverse proxy, with complete directive and module references

Approach

The book includes detailed instructions for each of the processes it describes: downloading and installing the application, configuring and using modules, and much more. It provides a step-by-step tutorial to replace your existing web server with Nginx. With commented configuration sections and in-depth module descriptions, you will be able to make the most of the performance potential offered by Nginx.

Who this book is for

By covering both early setup stages and advanced topics, this book will suit web administrators interested in solutions to optimize their infrastructure, whether they are looking into replacing existing web server software or integrating a new tool cooperating with applications already up and running. If you, your visitors, and your operating system have been disappointed by Apache, this book is exactly what you need.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

Nginx HTTP Server


Table of Contents

Nginx HTTP Server
Credits
About the Author
About the Reviewers
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Preparing your Work Environment
Setting up a terminal emulator
Finding and downloading PuTTY
Creating a session
Working with PuTTY and the shell
Basic shell commands
File and directory management
User and group management
Superuser account
User accounts
Group management
Programs and processes
Starting an application
System services
Process management
Finding the pid
An administrator's best friend top
Killing processes
Discovering the Linux filesystem
Directory structure
Special files and devices
Device types
Pseudo devices
Mounting a storage device
Files and inodes
EXT3 filesystem specifications
Filenames
Inodes
Atime, ctime, and mtime
Symbolic and hard links
File manipulation
Reading a file
Editing a file
Compression and archiving
System administration tools
Running a command as Superuser
Su command
Sudo command
System verification and maintenance
Disk Free
Disk Usage
Free memory
Software packages
Package managers
Downloading and installing packages manually
Building from source
Files and permissions
Understanding file permissions
Directory permissions
Octal representation
Changing permissions
Changing ownership and group
Summary
2. Downloading and Installing Nginx
Setting up the prerequisites
GCC-GNU Compiler Collection
PCRE library
zlib library
OpenSSL
Downloading Nginx
Websites and resources
Version branches
Features
Downloading and extracting
Configure options
The easy way
Path options
Prerequisites options
Module options
Modules enabled by default
Modules disabled by default
Miscellaneous options
Configuration examples
About the prefix switch
Regular HTTP and HTTPS servers
All modules enabled
Mail server proxy
Build configuration issues
Make sure you installed the prerequisites
Directories exist and are writable
Compiling and installing
Controlling the Nginx service
Daemons and services
User and group
Nginx command-line switches
Starting and stopping the daemon
Testing the configuration
Other switches
Adding Nginx as a system service
System V scripts
What is an init script?
Creating an init script for Nginx
Installing the script
Debian-based distributions
Red Hat-based distributions
Summary
3. Basic Nginx Configuration
Configuration file syntax
Configuration Directives
Organization and inclusions
Directive blocks
Advanced language rules
Directives accept specific syntaxes
Diminutives in directive values
Variables
String values
Base module directives
What are base modules?
Nginx process architecture
Core module directives
Events module
Configuration module
A configuration for your profile
Understanding the default configuration
Necessary adjustments
Adapting to your hardware
Testing your server
Creating a test server
Performance tests
Httperf
Autobench
OpenWebLoad
Upgrading Nginx gracefully
Summary
4. HTTP Configuration
HTTP Core module
Structure blocks
Module directives
Socket and host configuration
Paths and documents
Client requests
MIME Types
Limits and restrictions
File processing and caching
Other directives
Module variables
Request headers
Response headers
Nginx generated
The Location block
Location modifier
Search order and priority
Case 1:
Case 2:
Case 3:
Summary
5. Module Configuration
Rewrite module
Reminder on regular expressions
Purpose
PCRE syntax
Quantifiers
Captures
Internal requests
error_page
Rewrite
Infinite loops
Server Side Includes (SSI)
Conditional structure
Directives
Common rewrite rules
Performing a search
User profile page
Multiple parameters
Wikipedia-like
News website article
Discussion board
SSI module
Module directives and varia...

Table of contents

  1. Nginx HTTP Server

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Nginx HTTP Server by Clement Nedelcu in PDF and/or ePUB format, as well as other popular books in Computer Science & System Administration. We have over one million books available in our catalogue for you to explore.