Nginx - Engineering the Web

Table of Contents:
  1. Auto Start
  2. Customisations

nginx provides FastCGI and reverse HTTP proxying, with or without caching, including simple load balancing and fault tolerance.

It has a modular architecture. Filters include gzipping, byte ranges, chunked responses, and SSI. Multiple SSI inclusions within a single page can be processed in parallel if they are handled by FastCGI or proxied servers. SSL and TLS SNI are supported.

Auto Start

As nginx has become part of the standard install, auto starting the service during system restarts is a configuration file away:

File extract: /etc/rc.conf.local

nginx_flags=""

At system start up, rc.d(8) will check the rc(8) configuration files for the flag nginx_flags. If the flag is set to NO (the default) the service will not be started. Clearing the flag tells rc.d(8) to start nginx(8)

Configuring SSL

[Ref: httpsslmodule]

Configuring SSL is well documented

HTTP to HTTPS

[Ref: Serverfault]

Rewrite/Redirect of http:// connections to https:// has many options, the one which I like came out of a serverfault answer shown below:

 server {
    listen   80;
    listen   [::]:80;

    server_name www.example.com example.com other.example.com;

    return 301 https://$server_name$request_uri;
}
server {
    listen   443 default ssl;

    server_name www.example.com;

    ssl_certificate        /path/to/my/cert;
    ssl_certificate_key  /path/to/my/key;
}

Customisations

Life goes on.