Varnish and nginx on Centos 7

yum install varnish
yum install nginx

Config nginx listen on port 8081

server {
        listen 8081;
        rewrite ^(.*)$1 permanent;
server {
        listen 8081 default_server;



  • Config varnish: vi /etc/varnish/default.vcl (for wordpress)
# This is an example VCL file for Varnish.
# It does not do anything by default, delegating control to the

Nginx let's encrypt (IPv6, HTTP/2 and A+ SLL) on ubuntu

There are two modes when you don't want Certbot to edit your configuration: - Standalone: replaces the webserver to respond to ACME challenges - Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80) to renew certificates.

Nginx tuning for best perfomance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.


Nginx and Ajenti on ubuntu

Install Ajenti

apt-get update
wget -O- | apt-key add -
echo "deb main main ubuntu" >> /etc/apt/sources.list
apt-get update
apt-get install ajenti
service ajenti restart

Install Ajenti-v

apt-get install ajenti-v ajenti-v-nginx ajenti-v-mysql ajenti-v-php-fpm php-mysql 

If <3 Ruby

PHP7.2 Nginx and PHP7.2-FPM on Ubuntu 16.04

Install software-properties-common

sudo apt-get install -y software-properties-common

Install latest nginx version from community maintained ppa

sudo add-apt-repository ppa:nginx/stable

Update packages after adding ppa

sudo apt-get update

Install nginx

sudo apt-get install -y nginx

Check status

sudo service nginx

Start nginx if it is not already running

sudo service nginx start
nginx php72 fpm

PHP and NGINX on Amazon Linux AMI

Install NGINX

sudo yum install nginx -y

Install PHP and PHP-FPM

sudo yum install php -y
sudo yum install php-fpm -y

Configure NGINX (see below)

sudo nano /etc/nginx/conf.d/default.conf
server {
    listen 80;
    server_name www.exampledomain.tld exampledomain.tld;

    location / {
        root   /var/www/html;
        index  index.php index.html index.htm;

    location ~ \.php$ {
        root /var/www/html;
php nginx ami

QR Code for