All Projects → pothi → Wordpress Nginx

pothi / Wordpress Nginx

Licence: mit
WordPress specific Nginx configuration templates and best practices!

Projects that are alternatives of or similar to Wordpress Nginx

Slickstack
SlickStack is a free LEMP stack automation script written in Bash designed to enhance and simplify WordPress provisioning, performance, and security.
Stars: ✭ 311 (-6.33%)
Mutual labels:  wordpress, ubuntu, debian, nginx
Ansipress
AnsiPress - Simple L(Linux) E(NGINX) M(MariaDB) P(PHP7) Shared Hosting Setup
Stars: ✭ 184 (-44.58%)
Mutual labels:  wordpress, ubuntu, debian, nginx
Wordops
Install and manage a high performance WordPress stack with a few keystrokes
Stars: ✭ 649 (+95.48%)
Mutual labels:  wordpress, ubuntu, debian, nginx
Mtprotoproxyinstaller
One-click script to install MTProto Proxy server on CentOS, Ubuntu and Debian
Stars: ✭ 216 (-34.94%)
Mutual labels:  ubuntu, debian, centos
darknet.py
darknet.py is a network application with no dependencies other than Python and Tor, useful to anonymize the traffic of linux servers and workstations.
Stars: ✭ 71 (-78.61%)
Mutual labels:  debian, ubuntu, centos
Ansible Role Hardening
Ansible role to apply a security baseline. Systemd edition.
Stars: ✭ 188 (-43.37%)
Mutual labels:  ubuntu, debian, centos
Trojan Tutor.github.io
trojan 教程 自建梯子教程 trojan教程 trojan-gfw 科学上网 代理工具 翻墙 Ubuntu Debian 小白教程 https伪装
Stars: ✭ 150 (-54.82%)
Mutual labels:  ubuntu, debian, centos
Webinoly
Optimized LEMP Web Server to manage your WordPress, PHP, or simple HTML sites running on a powerful NGINX setup.
Stars: ✭ 254 (-23.49%)
Mutual labels:  wordpress, ubuntu, nginx
Kvm Install Vm
Bash script to build local virtual machines using KVM/libvirt and cloud-init.
Stars: ✭ 248 (-25.3%)
Mutual labels:  ubuntu, debian, centos
Server Manager
This repository holds the IntISP Interface. It can be rebuilt to interface with any other hosting panel.
Stars: ✭ 31 (-90.66%)
Mutual labels:  wordpress, ubuntu, debian
Ansible Wordpress
Ansible role to set up (multiple) wordpress installations in Debian-like systems (using wp-cli)
Stars: ✭ 58 (-82.53%)
Mutual labels:  wordpress, ubuntu, debian
dist-detect
Try to determine what Linux/Unix distribution is running on a remote host and get a hint if security updates are applied.
Stars: ✭ 14 (-95.78%)
Mutual labels:  debian, ubuntu, centos
ansible-role-daemonize
Ansible Role - Daemonize.
Stars: ✭ 14 (-95.78%)
Mutual labels:  debian, ubuntu, centos
ISPC-PHPCompiler
Compile and manage multiple PHP versions easily!
Stars: ✭ 35 (-89.46%)
Mutual labels:  debian, ubuntu, centos
Lamp
Install LAMP(Linux + Apache + MySQL/MariaDB + PHP ) for CentOS/Debian/Ubuntu
Stars: ✭ 2,456 (+639.76%)
Mutual labels:  ubuntu, debian, centos
Openvpn Install
OpenVPN road warrior installer for Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS and Fedora
Stars: ✭ 14,199 (+4176.81%)
Mutual labels:  ubuntu, debian, centos
Oracle Java
Ansible role to install Oracle Java 8/11 on Debian and RedHat based distributions.
Stars: ✭ 144 (-56.63%)
Mutual labels:  ubuntu, debian, centos
Dockerfiles
Phalcon Dockerfiles used for internal purposes.
Stars: ✭ 145 (-56.33%)
Mutual labels:  ubuntu, debian, centos
Wp Vps Build Guide
A verbose build guide for a modern, high-performance WordPress production VPS.
Stars: ✭ 31 (-90.66%)
Mutual labels:  wordpress, ubuntu, nginx
MisakaLinuxToolbox
御坂妹妹们的Linux VPS工具箱
Stars: ✭ 237 (-28.61%)
Mutual labels:  debian, ubuntu, centos

WordPress Nginx Configuration Templates

WordPress specific Nginx configurations, tweaks, and much more!

Features

There are multiplpe advantages of using this repo as your go-to nginx configuration.

  • Correct use of if statement because ifisevil.
  • SSL / LetsEncrypt / Certbot compatible.
  • Multisite support.
  • Contains ready-to-use sample vhost entries.
  • Continuously updated sample configurations with best practices.
  • IPv6 is supported out of the box.
  • Cloudflare support.
  • WebP support.

Available templates / vhost entries

  • WP Super Cache plugin (with support for SSL and separate mobile cache)
  • WP Rocket cache plugin (SSL and / or mobile supported out of the box)
  • WP Fastest Cache plugin (SSL and / or mobile supported out of the box)
  • Multisite (sub-domain and sub-directory)
  • Varnish with Nginx for SSL termination.
  • Custom error pages.
  • Catchall template.

Performance

  • All static content have maximum expiration headers.
  • SSL session cache is enabled by default.
  • Brotli compression support.
  • Open file cache support.
  • Server-level 301 support (for http => https, non-www => www, etc).
  • Autoptimize support.

Security

  • Support for strong dhparam.
  • TLSv1 and other insecure protocols are disabled by default.
  • Mitigate httpoxy vulnerability.
  • HSTS support.
  • Security headers to fit most sites (no CSP, though, as it varies depending on the site).
  • All hidden and backup files are forbidden by default.
  • Passes most security features in Sonar Scanner.
  • Gets 'A+' grade in Qualys SSL Labs.

Compatibility

Tested with the following servers...

  • Debian Debian 9 (Stretch)
  • Ubuntu 16.04 LTS (Xenial Xerus)
  • Ubuntu 18.04 LTS (Bionic Beaver)

Tested with the following Nginx versions...

  • Stable verisons 1.12.x and 1.14.x
  • Mainline versions 1.13.x, 1.15.x

For RPM based distros (Fedora, Redhat, CentOS and Amazon Linux AMI), the configuration mentioned in the repo is likely to work. Additional steps may be needed, though. See below for some details!

Changes on CentOS (and on rpm based distros in general)

CentOS has a different file naming convention, yet simple directory structure, when compared to Debian derivatives. Let me describe them and I'd let you decide upon how you'd want to structure your files and name those files.

  • The configuration for default sites are named as default.conf and ssl.conf in /etc/nginx/conf.d/.
  • There is no sites-available or sites-enabled folder.
  • The file /etc/nginx/fastcgi_params in Debian is named as /etc/nginx/fastcgi.conf in CentOS.

How to Deploy

Short answer: Use WordPress in a box. It sets up your server with all the goodies, including this repo!

Long answer:

Note: For all the steps mentioned below, sudo or root privilege is required!

Step #1 - Install Nginx

You may use the official Nginx repo or just use the Nginx package that comes with the OS. Both would work fine! I will leave the decision to you. Since, the installation process varies across Operating Systems, please refer the official installation guide to complete this step.

If you prefer to use the Nginx packages that comes with the OS, you may need to run the following...

sudo apt install nginx

or

sudo yum install nginx

Step #2 - Please backup your existing configuration files. Probably, have /etc under version control!

TIMESTAMP=$(date +%F_%H-%M-%S)
mkdir ~/nginx-backup-$TIMESTAMP
sudo cp -a /etc/nginx ~/nginx-backup-$TIMESTAMP

Step #3 - Copy this repo to your server.

git clone https://github.com/pothi/wordpress-nginx.git ~/git/wordpress-nginx
sudo cp -a ~/git/wordpress-nginx/* /etc/nginx/
sudo mkdir /etc/nginx/sites-enabled &> /dev/null
sudo cp /etc/nginx/nginx-sample.conf /etc/nginx/nginx.conf

Further steps varies depending on your particular requirement:

  • you may edit /etc/nginx/conf.d/lb.conf and update the upstream block for 'fpm' (one-off process; done automatically if you use WordPress in a LEMP Box)
  • then you may do the following for each vhost (domain), depending on your environment...
WP_DOMAIN=example.com
WP_ROOT=/path/to/wordpress/for/example.com
sudo cp /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-available/$WP_DOMAIN.conf
sudo sed -i 's:/home/username/sites/example.com/public:'$WP_ROOT':gp' /etc/nginx/sites-available/$WP_DOMAIN.conf
sudo sed -i 's/example.com/'$WP_DOMAIN'/g' /etc/nginx/sites-available/$WP_DOMAIN.conf
cd /etc/nginx/sites-enabled/
sudo ln -s ../sites-available/$WP_DOMAIN.conf
sudo nginx -t && sudo systemctl restart nginx

About me

Can you implement it on my server?

Yes, of course. My hourly rate is USD 50 per hour. Please contact me for any queries in this regard.

Have questions or just wanted to say hi?

Please ping me on Twitter or send me a message.

If you find this repo useful, please spread the word! Suggestions, discussion on best practices, bug reports, future requests, forks are always welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].