Category: Nginx

Nginx Bandwidth Limiting in LNMP Environments

I was looking into bandwidth throttling recently — out of pure boredom, really. For one, I don’t have any site that people are flocking to and relentlessly leeching data from, and for another, I honestly just didn’t know what else to tinker with… Bandwidth limiting under Nginx seems relatively straightforward. Below is the testing process I ran between two VPS instances, using a BlueVM $9.95/mo…

How to Install Nginx and PHP-FPM via YUM on CentOS 6

原文地址:http://www.lifelinux.com/how-to-install-nginx-and-php-fpm-on-centos-6-via-yum/ Before installing Nginx and PHP-FPM, you must remove any previously installed Apache and PHP from your system. Log in as root and enter the following command: # yum remove htt …

How to Yum Install Nginx on CentOS

Installing Nginx on Ubuntu is straightforward—just run `apt-get install nginx`. However, today I set up CentOS 6.2, and `yum install nginx` didn’t work right away. You need to configure the repository first. Here’s the complete installation process, which is also very simple: 1. For CentOS 6, first run:
rpm -ivh http://nginx.org/package …

Nginx Start, Restart, and Stop Commands

Stop OperationStopping Nginx is performed by sending signals to the Nginx process (for what signals are, please refer to Linux articles). Step 1: Find the Nginx master process IDps -ef | grep nginxLook for the master process in the process list; its number is the master process ID. Step 2: Send the signalGracefully stop N …

Nginx Tuning: A Performance Optimization Guide

Most Nginx installation guides cover the basics——install via apt-get, tweak a few lines of config here and there, and boom, you’ve got a web server! And, in most cases, a conventional Nginx install already works just fine for your website …

How to Hide the Nginx Version Number

How to Hide Nginx Version Number for Security

Nginx displays its version number prominently in the HTTP header or on error pages. For security reasons, it is generally recommended to hide this information.

The method is quite simple. Just add the server_tokens parameter inside the http { block of nginx.conf.
For example:
http { include mime.ty …

How to Handle Session Sharing with Nginx Load Balancer

1) Replace Sessions with Cookies

By replacing sessions with cookies, you can avoid some of the downsides of sessions. A J2EE book I once read also indicated that sessions should not be used in clustered systems, or else they can cause serious problems. If your system is not complex, first consider whether you can drop sessions …