Nginx HTTP Server. Adopt Nginx for your web applications to make the most of your infrastructure and serve pages faster than ever.

Similar documents
Nginx HTTP Server. Adopt Nginx for your web applications to make the most of your infrastructure and serve pages faster than ever.

Nginx HTTP Server Second Edition

Mastering phpmyadmiri 3.4 for

CHAPTER 1: A REFRESHER ON WEB BROWSERS 3

Requirements for ALEPH 500 Installation

Contents. Deployment: Automated Installation of Cygwin

Bitnami Dolibarr for Huawei Enterprise Cloud

"Charting the Course... MOC B: Linux System Administration. Course Summary

Xcalar Installation Guide

BIG-IP Access Policy Manager : Portal Access. Version 12.1

TH IRD EDITION. Python Cookbook. David Beazley and Brian K. Jones. O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Tokyo

Bitnami Coppermine for Huawei Enterprise Cloud

SAP Business One Components High Availability Guide, Version for SAP HANA

Bitnami ProcessMaker Community Edition for Huawei Enterprise Cloud

Bitnami Piwik for Huawei Enterprise Cloud

How To Start Mysql Using Linux Command Line Client In Ubuntu

Bitnami Tiny Tiny RSS for Huawei Enterprise Cloud

Prerequisites: General computing knowledge and experience. No prior knowledge with Linux is required. Supported Distributions:

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1

Bitnami TestLink for Huawei Enterprise Cloud

BIG-IP Access Policy Manager : Portal Access. Version 13.0

The 4D Web Companion. David Adams

Bitnami OSQA for Huawei Enterprise Cloud

"Charting the Course... RHCE Rapid Track Course. Course Summary

Bitnami Mantis for Huawei Enterprise Cloud

Bitnami Pimcore for Huawei Enterprise Cloud

Linux Essentials Objectives Topics:

client X11 Linux workstation

Sitemap. Component for Joomla! This manual documents version 22.x of the Joomla! extension.

Contents at a Glance COPYRIGHTED MATERIAL. Introduction...1 Part I: Becoming Familiar with Enterprise Linux...7

LINUX FUNDAMENTALS. Supported Distributions: Red Hat Enterprise Linux 6 SUSE Linux Enterprise 11 Ubuntu LTS. Recommended Class Length: 5 days

Microsoft Dynamics. Administration AX and configuring your Dynamics AX 2009 environment

Lecture Overview. IN5290 Ethical Hacking. Lecture 4: Web hacking 1, Client side bypass, Tampering data, Brute-forcing

Bitnami OroCRM for Huawei Enterprise Cloud

Header Status Codes Cheat Sheet

Bitnami Open Atrium for Huawei Enterprise Cloud

Prerequisites: Students should be comfortable with computers. No familiarity with Linux or other Unix operating systems is required.

Bitnami ez Publish for Huawei Enterprise Cloud

At course completion. Overview. Audience profile. Course Outline. : 55187B: Linux System Administration. Course Outline :: 55187B::

Jexus Web Server Documentation

LINUX FUNDAMENTALS (5 Day)

Installing AX Server with PostgreSQL (multi-server)

Foundations of Python

Linux Fundamentals (L-120)

The student will have the essential skills needed to be proficient at the Unix or Linux command line.

ZENworks Linux Management Version 6.5 Release Notes

Apica ZebraTester. Advanced Load Testing Tool and Cloud Platform

NGINX Plus Reference Guide

Exam LFCS/Course 55187B Linux System Administration

P a g e 1. Teknologisk Institut. Online kursus k SysAdmin & DevOps Collection

Bitnami Spree for Huawei Enterprise Cloud

OC://WebConnect User's Guide and Reference Version 3.2

Bitnami DokuWiki for Huawei Enterprise Cloud

Bitnami Moodle for Huawei Enterprise Cloud

Prerequisites: Students must be proficient in general computing skills but not necessarily experienced with Linux or Unix. Supported Distributions:

Snapt Accelerator Manual

1Z Oracle Linux Fundamentals (Oracle Partner Network) Exam Summary Syllabus Questions

Configuring a Windows Server 2008 Applications Infrastructure

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

CSET 4150 Web System Administration (3 semester credit hours) IT Required

Manually Password Protect Directories Apache Ubuntu

Mastering Linux. Paul S. Wang. CRC Press. Taylor & Francis Group. Taylor & Francis Croup an informa business. A CHAPMAN St HALL BOOK

Java.. servlets and. murach's TRAINING & REFERENCE 2ND EDITION. Joel Murach Andrea Steelman. IlB MIKE MURACH & ASSOCIATES, INC.

VMware Identity Manager Connector Installation and Configuration (Legacy Mode)

Mac OS X Server Web Technologies Administration. For Version 10.3 or Later

Bitnami ERPNext for Huawei Enterprise Cloud

INFUZE NGINX MODULE USER GUIDE

Saurus CMS Installation Guide

App Central: Developer's Guide. For APKG 2.0

Metasploit. Installation Guide Release 4.4

instant3dhub & WEBVIS Installation, Configuration & Operation Manual

COMPUTER NETWORKS AND COMMUNICATION PROTOCOLS. Web Access: HTTP Mehmet KORKMAZ

Textadept Quick Reference

Reading nginx CHANGES together

CONTENTS. Cisco Internet Streamer CDS 3.0 Software Configuration Guide iii OL CHAPTER 1 Product Overview 1-1

These instructions describe the system requirements and process for installing and initial configuration of jbase on Linux operating systems.

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Drupal

CompTIA Linux Course Overview. Prerequisites/Audience. Course Outline. Exam Code: XK0-002 Course Length: 5 Days

This Readme describes the NetIQ Access Manager 3.1 SP5 release.

ioncube Loader 10 User Guide

Introduction. What is Linux? What is the difference between a client and a server?

"Charting the Course... Enterprise Linux Security Administration Course Summary

Linux Kung Fu. Stephen James UBNetDef, Spring 2017

VMware AirWatch Content Gateway for Linux. VMware Workspace ONE UEM 1811 Unified Access Gateway

FAST, FLEXIBLE, RELIABLE SEAMLESSLY ROUTING AND SECURING BILLIONS OF REQUESTS PER MONTH

The WebGUI Runtime Environment. Roy Johnson Plain Black Corporation

CCMS Installation Instructions

NGINX Plus Reference Guide

Linux Administration

ioncube Loader 6.0 User Guide

HP Network Node Manager 9: Getting Started. Manage your network effectively with NNMi. Marius Vilemaitis. J enterprise PUBLISHING MUMBAI BIRMINGHAM

"Charting the Course B Configuring, Managing and Troubleshooting Microsoft Exchange Server 2010 Course Summary

Contents in Detail. Acknowledgments

F-Secure Policy Manager Proxy Administrator's Guide

Fundamentals of Web Development. Web Development. Fundamentals of. Global edition. Global edition. Randy Connolly Ricardo Hoar

How to work with HTTP requests and responses

Bitnami Trac for Huawei Enterprise Cloud

VII. Corente Services SSL Client

Transferring Files Using HTTP or HTTPS

Administrator s Guide. StorageX 8.0

Transcription:

Nginx HTTP Server Adopt Nginx for your web applications to make the most of your infrastructure and serve pages faster than ever element Nedelcu [ ] ~men~e~eri~c::i~li~dce PUBLISHING BIRMINGHAM - MUMBAI

Table of Contents Preface Chapter 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 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 1 7 7 8 8 10 11 11 15 15 15 17 18 18 19 20 22 22 25 25 26 27 28 29 29 29 30 31 32 33

Table of Contents 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 Chapter 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 34 35 37 37 37 38 39 39 39 40 40 40 41 42 43 43 43 44 44 45 46 47 47 48 49 50 50 51 51 52 53 54 55 55 56 58 59 59 60 61 62 63 63 64 [ ii ]

Table ofcontents 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 Chapter 3: Basic Nginx Configuration Configuration file syntax Configuration Directives Organization and inclusions Directive blocks Advanced language rules Directives accept specific synlaxes 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 64 65 65 65 66 67 67 68 68 69 69 70 71 71 73 73 75 76 76 77 79 79 80 81 83 84 84 85 86 86 86 87 87 88 93 95 95 95 96 97 99 99 ~---~.~-------- [iii]--------------

Table ofcontents Performance tests Httperf Autobench OpenWebload Upgrading Nginx gracefully Chapter 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 Gase 1: Gase 2: Gase 3: Chapter 5: Module Configuration Rewrite module Reminder on regular expressions Purpose PGRE syntax Quantifiers Gaptures Internal requests error_page Rewrite Infinite loops Server Side Includes (551) Conditional structure Directives Common rewrite rules 100 101 102 103 105 106 107 107 108 109 110 114 117 121 123 125 127 130 130 131 132 133 133 136 137 138 138 139 141 141 142 142 142 144 145 146 147 148 149 150 151 153 156 -------------- [iv] --------------

Table ofcontents Performing a search User profile page Multiple parameters Wikipedia-like News website article Discussion board 551 module Module directives and variables SSI Commands File includes Working with variables Conditional structure Configuration Additional modules Website access and logging Index Autoindex Random index Log Limits and restrietions Auth_basic module Access Limit zone Limit request Content and encoding Empty GIF FLV HTTP headers Addition Substitution Gzip filter Gzip static Charset filter Memcached Image filter XSLT About your visitors Browser Map Geo GeolP UserlD filter Referer RealiP SSL and security SSL Setting up an SSL certificate Secure link 156 156 156 157 157 157 157 158 160 160 162 163 163 164 164 164 165 166 166 168 168 168 169 169 170 170 171 171 172 172 173 175 175 176 178 179 179 179 180 180 181 181 182 183 183 183 185 186 [v] --------------

Table ofcontents Other miscellaneous modules Stub status Google-perftools WebDAV Third-party modules Chapter 6: PHP and Python with Nginx Introduction to FastCGI Understanding the mechanism Common Gateway Interface (CGI) Fast Common Gateway Interface (FastCGI) Main directives FastCGI caching Upstream blocks Module syntax Server directive PHP with Nginx Architecture PHP FPM Setting up PHP and PHP-FPM Downloading and extraeting Patching Requirements Building PHP Post-install configuration Running and controlling Nginx configuration Python and Nginx Django Setting up Python and Django Python Django Starting the FastCGI process manager Nginx configuration Chapter 7: Apache and Nginx Together Nginx as reverse proxy Understanding the issue The reverse proxy mechanism Advantages and disadvantages Nginx Proxy module Main directives 187 187 187 188 189 190 191 192 192 193 194 195 201 204 205 206 207 207 208 208 208 209 209 209 210 210 211 212 212 213 213 213 214 215 215 217 217 218 219 220 221 222 ------------- [vi] --------------

Table 0/ Contents Caching, buffering, and temporary files Limits, timeouts, and errors Other directives Variables Configuring Apache and Nginx Reconfiguring Apache Configuration overview Resetting the port number Accepting local requests only Configuring Nginx Enabling proxy options Separating content Advanced configuration Additional steps Forwarding the correct IP address SSL issues and solutions Server control panel issues Chapter 8: From Apache to Nginx Nginx versus Apache Features Core and functioning General functionality Flexibility and community Performance Usage Conclusion Porting your Apache configuration Directives Modules Virtual hosts and configuration sections Configuration sections Creating a virtual host htaccess files Reminder on Apache.htaccess files Nginx equivalence Rewrite rules General remarks On the location On the syntax RewriteRule 225 228 229 230 230 231 231 231 232 233 233 235 237 238 238 239 239 240 241 241 242 242 243 244 244 245 246 246 246 249 250 250 251 254 254 255 257 257 257 258 259 -------------- (vii]--------------

Table o[ Con tents WordPress MediaWiki vbulietin Appendix A: Directive Index Appendix B: Module Reference Access Addition* Auth_basic module Autoindex Browser Charset Core DAV* Empty GIF Events FastCGI FLV* Geo Geo IP* Google-perftools* Gzip Gzip Static* Headers HTTP Core Image Filter* Index Limit Requests Limit Zone Log Map Memcached Proxy Random index* ReallP* Referer Rewrite Secure Link* SSI SSL* 259 261 262 263 265 287 287 287 288 288 288 288 289 289 289 289 290 290 290 290 291 291 291 291 292 292 292 292 293 293 293 293 294 294 294 294 295 295 295 295 -------------[viii]-------------

Table ofcontents Stub status* Substitution* Upstream User 10 XSLT* Appendix C: Troubleshooting General tips on troubleshooting Checking access permissions Testing your configuration Have you reloaded the service? Checking logs Install issues 403 Forbidden custom error page Location block priorities If block issues Inefficient statements Unexpected behavior Index 296 296 296 296 297 299 299 299 300 300 300 301 301 302 303 303 304 305 -------------- [ix] --------------