FAQ

Page Discussion Edit History

NginxGettingStarted

Contents

Edit section: Why Nginx? Why Nginx?

Nginx is a high-performance web and proxy server. It has a lot of features, but it's not for everyone. People generally use Nginx:

  • As an Apache replacement that gracefully handles many concurrent connections: Nginx is especially popular among web hosting providers. 50,000 simultaneous connections have been reported, thanks to Nginx's use of epoll and kqueue .
  • As a load-balancing proxy server: Nginx is a popular front-end to Rails and PHP applications, either via FastCGI or HTTP . Written in C, it consumes about a quarter of the CPU that Perlbal uses.
  • As a mail proxy server: more of a niche application, but fastmail.fm reports great success.
  • As a server with a simple [#installation installation] process, a clean configuration file, and few bugs : Nginx is easy to get running, and it almost never needs restarting. You can even upgrade the binary with zero downtime .

To learn more about Nginx's features and performance, check out the Feature Overview and Testimonials pages.

Edit section: Requirements Requirements

  • gzip module requires zlib library
  • rewrite module requires pcre library
  • ssl support requires openssl library

Edit section: Download Download

See the official download page .

Template:Anchor

Edit section: Installation Installation

After extracting the source, run these commands from a terminal:

./configure
make
sudo make install

By default, Nginx will be installed in /usr/local/nginx. You may change this and other options with the compile-time options .

Edit section: Platform-specific Notes and Builds Platform-specific Notes and Builds

  1. Notes on building Nginx on Ubuntu
  2. Ubuntu Easy installer script with PHP support and MySQL
  3. Installing Nginx on Fedora, RHEL or CentOS
  4. How to get the latest Nginx on Gentoo
  5. x86/64 build for Solaris
  6. How to Compile nginx on MacOSX
  7. Nginx building script for Slackware
  8. Nginx for Windows (32-bit); development, stable, and legacy binaries available

Edit section: Running Nginx Running Nginx

Start the server by running /usr/local/nginx/sbin/nginx as root. After editing the configuration file at /usr/local/nginx/conf/nginx.conf to your liking, you can reload the configuration with:

  kill -HUP `cat /usr/local/nginx/logs/nginx.pid`

The location of nginx.pid might be different on your machine. For Ubuntu, it is located at:

  /var/run/nginx.pid

See also:

Edit section: Advanced topics Advanced topics