𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Nginx From Beginner to Pro

✍ Scribed by Soni, Rahul


Publisher
Apress
Year
2016
Tongue
English
Leaves
255
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Teaches you to start up Nginx and quickly take your expertise to a level where you can comfortably work with various aspects of the web server and make informed design decisions for your web farm. Nginx powers more than 40% of the top 1000 websites and is among the handful of web servers that can handle more than 10K simultaneous connections. It has some features which are simply unparalleled.
Nginx: From Beginner to Proteaches the Nginx server in a practical way. Frequently, it is found that web administrators struggle to fix the skill set gaps that happen due to a platform change. Migration from IIS & Apache becomes tedious at best. The book is targeted toward real-world administrators who would want to get up to speed as soon as possible and make good, informed design decisions. First you will set up Nginx and understand the architectural nuances. Then you will learn how to scale out, secure, monitor and troubleshoot the web server. Once you are fully comfortable with Nginx, you will start learning about migrating applications (or its part) from IIS or Apache web servers. Finally, you will learn to troubleshoot and maintain your Nginx professionally.
Written by an author who has gone through the rough phase while moving from IIS/Apache to Nginx, this book is practical and filled with step-by-step instructions to make your time with Nginx as straightforward as possible.
What You Will Learn
Install and set up Nginx on CentOS, Ubuntu & Mac.


Understand Nginx modules and compiling Nginx with appropriate modules.


Learn about basic configuration and architecture along with hosting nuances.


Load balance Nginx and use it as a highly available web platform.


Monitor traffic and automate common administrative tasks.


Use scripts to perform routine checks for health issues.


Implement security and authentication in Nginx.


Learn how and what to migrate from IIS & Apache web servers.

Who This Book Is For
Provides a crisp background of Nginx and then gears towards technical and practical topics. You need to know HTTP protocol, and have basic knowledge of Linux and networking concepts. The target audience is web administrators who would like to learn the finer nuances of Nginx, or map their existing skillset from IIS or Apache.

✦ Table of Contents


Contents at a Glance......Page 6
Contents......Page 8
About the Author......Page 18
About the Technical Reviewer......Page 20
Acknowledgments......Page 22
HTTP Basics......Page 23
What Is a Web Server?......Page 25
It Scales Well......Page 26
More Than Just a Web Server......Page 27
Low Resource Requirement and Consumption......Page 28
HTTP Video Streaming Using MP4/FLV/HDS/HLS......Page 29
Enterprise Features of Nginx Plus......Page 30
Content Caching Enhanced Capabilities......Page 31
Progressive Download......Page 32
Live Activity Monitoring......Page 33
Differences between Apache and Nginx......Page 34
Availability......Page 35
Modules (or Plug-Ins)......Page 36
Summary......Page 37
Preparing Your Environment......Page 38
On CentOS......Page 40
On Ubuntu Server......Page 41
Nginx Folder Structure......Page 42
On Ubuntu......Page 43
Understanding the Nginx Source Directory......Page 44
Build Tools for Compilation......Page 45
On CentOS......Page 46
On Ubuntu......Page 47
On CentOS......Page 48
On CentOS......Page 49
Compile-Time Options......Page 50
Nginx Configuration Paths Options......Page 51
Enabling Nginx Modules......Page 52
Disabling Nginx Modules......Page 54
Prerequisite Modules......Page 55
zlib Options......Page 56
Other Options......Page 57
Compiling and Installing Nginx......Page 58
Manual Configuration......Page 59
Scripted Configuration......Page 60
Troubleshooting Service Start......Page 62
Verifying Web Server Installation......Page 63
On Ubuntu......Page 64
Nginx in Amazon Elastic Compute Cloud (EC2)......Page 65
Summary......Page 68
What Are Directives?......Page 69
Context Types......Page 70
Simple Directives......Page 71
Events Context......Page 73
HTTP Context......Page 74
The conf.d Folder......Page 76
Server Context......Page 77
Visualizing Routing Rules......Page 80
Location Context......Page 82
try_files......Page 89
rewrite......Page 90
error_page......Page 91
Allow Directory Listing......Page 92
Proxy the Requests to FastCGI......Page 93
Nginx Variables......Page 94
Summary......Page 95
Default Installation......Page 96
On Ubuntu Server......Page 97
Third-Party Modules......Page 98
How Modules Fit in Nginx......Page 99
Core Module......Page 100
Events Module......Page 102
HTTP Module......Page 103
Gzip Module......Page 107
FastCGI Module......Page 108
Basic Authentication......Page 109
PAM Authentication......Page 110
Compiling the Module with Nginx......Page 111
Implementing the Module in Nginx......Page 112
Validating the Module......Page 113
Summary......Page 114
A Quick Analogy......Page 115
The Master Process......Page 116
Processes vs. Threads......Page 117
The Worker Process......Page 118
State Machines......Page 120
HTTP Request Processing in Nginx......Page 122
Summary......Page 124
Chapter 6: Hosting Web Sites on Nginx......Page 125
Web Server Setup......Page 126
Connecting Host and Guest Servers......Page 128
User Creation......Page 129
Uploading Content......Page 130
Hosting Websites......Page 133
Websites Using Different Names......Page 137
Websites Using Domain Name......Page 139
Internal Redirects......Page 140
Sites Using Different Ports......Page 141
Wildcard Mapping......Page 142
Domain Name Mapping......Page 143
IP-Based Hosting......Page 144
Root Inside Location Block......Page 145
Unnecessary Complications......Page 146
Summary......Page 147
Sudo Scare......Page 148
Installing MySQL......Page 149
Installing PHP......Page 151
Configure Nginx for WordPress......Page 156
Installing MongoDB......Page 165
Installing Angular.JS......Page 166
Creating a MEAN Application......Page 167
Configure Nginx for MEAN Stack......Page 168
Summary......Page 169
Defining High Availability......Page 170
Load Balancing for High Availability......Page 172
Flexibility......Page 173
Elasticity......Page 174
Clean Up the Servers......Page 175
Configure WFE1 and WFE2......Page 176
Set Up NLB Server......Page 177
Round Robin......Page 179
Generic Hash......Page 180
Load Balancing Scenarios......Page 181
Passing the HOST Header......Page 182
Forwarding IP Information......Page 184
Nginx Caching......Page 185
Configure Nginx (PLUS) for Heath Checks......Page 186
Activity Monitoring in Nginx (PLUS)......Page 187
Summary......Page 188
Error Log......Page 189
Access Log......Page 191
What to Log?......Page 192
Log Compression......Page 193
Syslog......Page 194
ngxtop......Page 195
GoAccess......Page 198
Custom Error pages......Page 200
Benchmark......Page 203
Apache Benchmark......Page 204
Monitoring......Page 206
Nginx PLUS......Page 207
Automation......Page 208
Summary......Page 210
Capturing Network Traffic with Wireshark......Page 211
Using Secure HTTP......Page 213
SSL Encryption......Page 216
Enabling SSL Nginx......Page 217
Optimizing HTTPS Servers......Page 219
Creating a Certificate Request......Page 221
Creating the Password File......Page 222
Configuring Nginx Password Authentication......Page 223
Summary......Page 224
Controlling Nginx......Page 225
Command-Line Parameters......Page 226
Feature Comparison......Page 229
Configuration Comparison......Page 231
Summary......Page 232
Scenario 1: Page Cannot Be Displayed in the Browser......Page 233
Scenario 3: Bad Permissions......Page 236
Scenario 6: Log Only Your Requests......Page 237
htop......Page 238
ulimit......Page 239
powertop......Page 240
iotop......Page 241
Nagios......Page 242
Having Root Inside Location Block......Page 243
Using if Blocks......Page 244
Rewrite Issues......Page 246
β€œIs there a location for sample configurations?”......Page 247
β€œHow can I write all http requests to https while maintaining a sub-domain?”......Page 248
Summary......Page 249
Index......Page 250


πŸ“œ SIMILAR VOLUMES


Nginx: from beginner to pro
✍ Rahul Soni πŸ“‚ Library πŸ“… 2016 πŸ› Apress, Berkeley, CA 🌐 English

This book teaches you to start up Nginx and quickly take your expertise to a level where you can comfortably work with various aspects of the web server and make informed design decisions for your web farm. Nginx powers more than 40% of the top 1000 websites and is among the handful of web servers t

Nginx: from beginner to Pro
✍ Soni, Rahul πŸ“‚ Library πŸ“… 2016 πŸ› Apress 🌐 English

This book teaches you to start up Nginx and quickly take your expertise to a level where you can comfortably work with various aspects of the web server and make informed design decisions for your web farm. Nginx powers more than 40% of the top 1000 websites and is among the handful of web servers t

Nginx: From Beginner to Pro
✍ Rahul Soni (auth.) πŸ“‚ Library πŸ“… 2016 πŸ› Apress 🌐 English

Teaches you to start up Nginx and quickly take your expertise to a level where you can comfortably work with various aspects of the web server and make informed design decisions for your web farm. Nginx powers more than 40% of the top 1000 websites and is among the handful of web servers that can ha

Beginning C - From Beginner to Pro.
✍ German Gonzalez-Morris, Ivor Horton πŸ“‚ Library πŸ“… 2020 πŸ› Apress 🌐 English

Learn how to program using C, beginning from first principles and progressing through step-by-step examples to become a competent, C-language programmer. All you need are this book and any of the widely available C compilers, and you'll soon be writing real C programs. You’ll discover that C is a

Beginning C: From Beginner to Pro
✍ German Gonzalez-Morris, Ivor Horton πŸ“‚ Library πŸ“… 2024 πŸ› Apress 🌐 English

Learn how to program using C, beginning from first principles and progressing through step-by-step examples. This seventh edition is fully updated to reflect new features of C23, and addresses deprecated functions and features that are no longer supported. You’ll discover that C is a foundation l

Beginning C: From Beginner to Pro
✍ German Gonzalez-Morris, Ivor Horton πŸ“‚ Library πŸ“… 2024 πŸ› Apress 🌐 English

<p><span>Learn how to program using C, beginning from first principles and progressing through step-by-step examples. This seventh edition is fully updated to reflect new features of C23, and addresses deprecated functions and features that are no longer supported.</span></p><p><span>You’ll discover