Book Image

Nginx 1 Web Server Implementation Cookbook

By : Dipankar Sarkar
Book Image

Nginx 1 Web Server Implementation Cookbook

By: Dipankar Sarkar

Overview of this book

<p>Nginx is an open source high-performance web server, which has gained quite some popularity recently. Due to its modular architecture and small footprint, it has been the default choice for a lot of smaller Web 2.0 companies for use as a load-balancing proxy server. It supports most of the existing back-end web protocols like FCGI, WSGI, and SCGI. This book is for you if you want to have in-depth knowledge of the Nginx server.<br /><br /><i>Nginx 1 Web Server Implementation Cookbook</i> covers the whole range of techniques that would prove useful for you in setting up a very effective web application with the Nginx web server. It has recipes for lesser-known applications of Nginx like a mail proxy server, streaming of video files, image resizing on the fly, and much more.<br /><br />The first chapter of the book covers the basics that would be useful for anyone who is starting with Nginx. Each recipe is designed to be independent of the others.<br /><br />The book has recipes based on broad areas such as core, logging, rewrites, security, and others. We look at ways to optimize your Nginx setup, setting up your WordPress blog, blocking bots that post spam on your site, setting up monitoring using munin, and much more.</p> <p>Nginx 1 Web Server Implementation Cookbook makes your entry into the Nginx world easy with step-by-step recipes for nearly all the tasks necessary to run your own web application.</p>
Table of Contents (17 chapters)
Nginx 1 Web Server Implementation Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Setting up streaming for Flash files


Video has become quite the dominant format on the net. It is also fair to say that Flash has been the driving force behind this over the last couple of years. YouTube (http://youtube.com) is a good example of FLV streaming video sites. In this recipe, we will look at how simple it is to set up Flash video streaming.

How to do it...

In this simple recipe, you will initially need to re-compile Nginx with the FLV module and then configure the directories that will serve the FLV files.

  1. You will need to recompile Nginx and add the following flag to the configure option:

    ./configure --with-http_flv_module
    Make && make install
    
  2. You will then need to add the following configuration to the directory location where you are streaming it from:

    location ~ \.flv$ {
      flv;
    }
  3. You will then need to restart Nginx.

How it works...

This is a fairly simple setup where you will not need to do a lot to get FLV streaming working in no time. This module allows you to seek within...