≡ Menu

Nginx Tutorials and HowTos

Nginx is a free, open-source, high-performance HTTP server and reverse proxy software. This section includes tutorials about Nginx configuration, security, optimization, and tips under Unix like operating systems ( rss feed ).

NGINX: Create Custom 404 / 403 Error Page

How do I create a custom static HTTP 404 or HTTP 403 error page under nginx web server?
[click to continue…]

nginx: Install GeoIP Module For Country / City Level Geo Targeting

How do I install GeoIP nginx module for country and/or city level geo targeting?
[click to continue…]

Nginx: Configure and Install With IPv6 Networking Support

How do I configure IPv6 networking under nginx? How do I assign and use an IPv6 address under nginx web server? How do I enable IPv6 Support in nginx?
[click to continue…]

nginx: Send HTTP User Agent Requests To Specific Backend Server

I've tons of images, css and javascript hosted at backend server IP 192.168.1.5 and 192.168.1.6. How do I make sure nginx reverse proxy load balancer always send all http_user_agent requests coming from "Mozilla" to server 192.168.1.5 and MSIE to server 192.168.1.6 only?
[click to continue…]

Nginx: 24: Too Many Open Files Error And Solution

I'm getting the following error in my nginx server error log file:

2010/04/16 13:24:16 [crit] 21974#0: *3188937 open() "/usr/local/nginx/html/50x.html" failed (24: Too many open files), client: 88.x.y.z, server: example.com, request: "GET /file/images/background.jpg HTTP/1.1", upstream: "http://10.8.4.227:81//file/images/background.jpg", host: "example.com"

How do I fix this problem under CentOS / RHEL / Fedora Linux or UNIX like operating systems?
[click to continue…]

Nginx: Custom Error 403 Page Not Working with IP Deny Configuration

I block or deny access based on the host name or IP address of the client visiting website under nginx web server. I want to display customized e403.html error page, but it doesn't appear to be working. Nginx always displays the built-in, hardcoded "403 Forbidden" error message. Here is my configuration:

.....
  ...
 deny 1.2.3.4;
 deny 91.212.45.0/24;
 deny 91.212.65.0/24;
 .....
 ...
 error_page 403 /e403.html;
        location = /e403.html {
           root   html;
       }

How do I fix this problem and display custom error 403 page under nginx server?
Answer to “Nginx: Custom Error 403 Page Not Working with IP Deny Configuration”

Linux nginx: Chroot (Jail) Setup

How do I run Nginx web server in a chroot (jail) so that I can minimizes the damage done by a potential break-in by isolating the web server to a small section of the filesystem?
[click to continue…]

nginx: Setup SSL Reverse Proxy (Load Balanced SSL Proxy)

A reverse proxy is a proxy server that is installed in a server network. Typically, reverse proxies are used in front of Web servers such as Apache, IIS, and Lighttpd. How do I setup nginx web server as SSL reverse proxy?
[click to continue…]

nginx: Send Custom HTTP Headers

How do I send or set arbitrary HTTP headers using nginx web server?
[click to continue…]

Handling nginx Failover With KeepAlived

How do configure to release and obtain VIP (virtual IP) when nginx is dead, down or system is rebooted for the kernel upgrades?
[click to continue…]