SlideShare una empresa de Scribd logo
1 de 38
WordPress-NGINX Best Practices 
(With EasyEngine) 
by Rahul Bansal (rtCamp)
WordPress-NGINX - Best practices
The Rule! 
“If you can do it in NGINX, just do it in 
NGINX!”
#1. nginx fastcgi-cache
Purpose 
● Best solution for serving content to non-logged 
in users 
● Should be used instead full-page-cache from 
WordPress plugin
Global Code Fragment 
fastcgi_cache_path /var/run/nginx-cache levels=1:2 
keys_zone=WORDPRESS:100m inactive=60m; 
fastcgi_cache_key 
"$scheme$request_method$host$request_uri"; 
fastcgi_cache_use_stale error updating timeout 
invalid_header http_500;
Site config 
server { 
location ~ .php$ { 
try_files $uri =404; 
include fastcgi_params; 
fastcgi_pass 127.0.0.1:9000; 
fastcgi_cache WORDPRESS; 
fastcgi_cache_valid 60m; 
fastcgi_cache_bypass $skip_cache; 
fastcgi_no_cache $skip_cache;}}
Cache conditions 
set $skip_cache 0; 
if ($request_method = POST) { set $skip_cache 1; } 
if ($query_string != "") { set $skip_cache 1; } 
if ($request_uri ~* "/wp-admin/|/xmlrpc.php|wp- 
.*.php|index.php") { 
set $skip_cache 1; } 
if ($http_cookie ~* "comment_author|wordpress_[a-f0- 
9]+|wordpress_logged_in") { 
set $skip_cache 1; }
Cache conditions 
if ($request_uri ~* "/store/|/random/|/wp-admin/|...") { 
set $skip_cache 1; } 
if ($http_cookie ~* "comment_author||yummy_cookie|...") { 
set $skip_cache 1; } 
if ($remote_addr ~* "1.2.3.4") { 
set $skip_cache 1; }
Caching search result pages 
if ($query_string != "") { 
set $skip_cache 1; } 
# for http://example.com/?s=hello 
if ($arg_s != "") { 
set $skip_cache 0; }
Caching multiple versions of a page 
# Cookie Example 
fastcgi_cache_key "$scheme$request_method$host$request_uri$cookie_country"; 
# User-Agent Example 
set $mobile no; 
if ($http_user_agent ~* "iphone|android|blackberry|netfront") { 
set $mobile yes;} 
fastcgi_cache_key "$scheme$request_method$host$request_uri$mobile";
#2. NGINX substitution module 
CDN & SSL Warning fix
CDN (Origin Pull) 
Original URL => example.com/wp-content/uploads/hello.jpg 
CDN URL => cdn.example.com/wp-content/ 
uploads/hello.jpg 
sub_filter "example.com/wp-content/uploads/" 
"cdn.example.com/wp-content/uploads/"; 
sub_filter_last_modified on; 
sub_filter_once off;
SSL - mixed content warning fix 
sub_filter "http://example.com/wp-content/" 
"https://example.com/wp-content/"; 
sub_filter_last_modified on; 
sub_filter_once off;
#3. pagespeed module 
Reduce load time
pagespeed module 
● css/js minify & combine. 
● search-replace URL for CDN 
● on the fly image (lossless) compression 
● lazy loading for images
site specific filters 
# CSS 
pagespeed EnableFilters combine_css,rewrite_css; 
# JS 
pagespeed EnableFilters combine_javascript,rewrite_javascript; 
# Images 
pagespeed EnableFilters lazyload_images; 
pagespeed EnableFilters rewrite_images; 
pagespeed EnableFilters convert_jpeg_to_progressive
pagespeed global config 
# Turning the module on and off 
pagespeed on; 
# Configuring PageSpeed Filters 
pagespeed RewriteLevel PassThrough; 
# Needs to exist and be writable by nginx. Use tmpfs for best performance. 
pagespeed FileCachePath /var/ngx_pagespeed_cache;
#4. Upstream Module 
Load Balancer/Failover
load balance mode 
upstream backend { 
ip_hash; 
server 1.1.1.1; 
server 2.2.2.2; 
server 2.2.2.2; 
}
failover mode 
upstream backend { 
server 1.1.1.1 max_fails=3 fail_timeout=30s; 
server 2.2.2.2 backup; 
}
Front-end site config 
location / { 
proxy_pass http://backend; 
proxy_set_header Host $host; 
proxy_set_header X-Real-IP $remote_addr; 
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
proxy_set_header X-Forwarded-Proto $scheme; 
#proxy_cache 
}
Backend NGINX Config 
#gloabal config 
set_real_ip_from 9.9.9.9; 
real_ip_header X-Forwarded-For;
What if load balancer fails? 
● Configure backend server with NGINX in a 
way that it can run as standalone server 
● Use DNS-based failover to switch traffic from 
load balancer to a backend server
#5. Upstream mod with HHVM 
Speed for logged in users
HHVM with PHP-FPM fallback 
upstream php { 
server 127.0.0.1:8000; #hhvm 
server 127.0.0.1:9000 backup; #php-fpm 
}
More Tricks 
The list is endless!
SSL and spdy 
#enable SSL cache 
ssl_session_cache shared:SSL:20m; 
ssl_session_timeout 10m; 
#enable spdy 
server { 
listen 443 ssl spdy; 
}
URL Redirection 
#For Single URL 
location = /old/path { 
return 301 http://foo.com/new/url; 
} 
#For Complete Section 
location ~ /old/(.*) { 
return 301 http://foo.com/new/$1; 
}
Security with Limit Request Module 
#global 
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; 
#server 
location = /wp-login.php { 
limit_req zone=one burst=1 nodelay; 
include fastcgi_params; 
fastcgi_pass 127.0.0.1:9000; 
}
Memcache/Redis - Distributed Cache 
● For wordpress site is spread across multiple servers 
● Only extra work is, WordPress/PHP side codes are 
needed to “fill” cache 
● For Memcache, NGINX has a core and few third party 
modules 
● For redis, NGINX has third party modules
Using EasyEngine
What is EasyEngine? 
● A script to setup and manage multiple 
wordpress sites with NGINX web server 
● Always up to date with best practices, 
including most of the stuff we discussed so 
far
Getting Started 
#install easy-engine 
wget -qO ee rt.cx/ee && sudo bash ee 
#install nginx, php, mysql, postfix 
ee stack install 
#install WordPress on example.com 
ee site create example.com --wpfc
WordPress Multisite Handling 
#multisite with subdirectory 
ee site create example.com --wpfc --wpsubdir 
#multisite with subdomain 
ee site create example.com --wpfc --wpsubdom
EasyEngine Demo
EasyEngine Resources 
Home : http://rtcamp.com/easyengine 
Github : http://github.com/rtCamp/easyengine 
Forum : http://community.rtcamp.com/category/easyengine/
Q&A 
mailto: rahul.bansal@rtcamp.com 
or better, join the discussion on 
http://community.rtcamp.com/

Más contenido relacionado

La actualidad más candente

golang_getting_started.pptx
golang_getting_started.pptxgolang_getting_started.pptx
golang_getting_started.pptxGuy Komari
 
[CB21] MUSHIKAGO: IT and OT Automation Penetration testing Tool Using Game AI...
[CB21] MUSHIKAGO: IT and OT Automation Penetration testing Tool Using Game AI...[CB21] MUSHIKAGO: IT and OT Automation Penetration testing Tool Using Game AI...
[CB21] MUSHIKAGO: IT and OT Automation Penetration testing Tool Using Game AI...CODE BLUE
 
Node.js Event Emitter
Node.js Event EmitterNode.js Event Emitter
Node.js Event EmitterEyal Vardi
 
Kotlin Coroutines Reloaded
Kotlin Coroutines ReloadedKotlin Coroutines Reloaded
Kotlin Coroutines ReloadedRoman Elizarov
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN GolangBo-Yi Wu
 
Top Libraries for Machine Learning with Python
Top Libraries for Machine Learning with Python Top Libraries for Machine Learning with Python
Top Libraries for Machine Learning with Python Chariza Pladin
 
Kotlin Coroutines and Android sitting in a tree
Kotlin Coroutines and Android sitting in a treeKotlin Coroutines and Android sitting in a tree
Kotlin Coroutines and Android sitting in a treeKai Koenig
 
Netflix SRE perf meetup_slides
Netflix SRE perf meetup_slidesNetflix SRE perf meetup_slides
Netflix SRE perf meetup_slidesEd Hunter
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with PythonLarry Cai
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 
Prometheus Training
Prometheus TrainingPrometheus Training
Prometheus TrainingTim Tyler
 

La actualidad más candente (20)

golang_getting_started.pptx
golang_getting_started.pptxgolang_getting_started.pptx
golang_getting_started.pptx
 
JSP Directives
JSP DirectivesJSP Directives
JSP Directives
 
File Handling in Python
File Handling in PythonFile Handling in Python
File Handling in Python
 
[CB21] MUSHIKAGO: IT and OT Automation Penetration testing Tool Using Game AI...
[CB21] MUSHIKAGO: IT and OT Automation Penetration testing Tool Using Game AI...[CB21] MUSHIKAGO: IT and OT Automation Penetration testing Tool Using Game AI...
[CB21] MUSHIKAGO: IT and OT Automation Penetration testing Tool Using Game AI...
 
Node.js Event Emitter
Node.js Event EmitterNode.js Event Emitter
Node.js Event Emitter
 
Kotlin Coroutines Reloaded
Kotlin Coroutines ReloadedKotlin Coroutines Reloaded
Kotlin Coroutines Reloaded
 
php
phpphp
php
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Python Programming Essentials - M24 - math module
Python Programming Essentials - M24 - math modulePython Programming Essentials - M24 - math module
Python Programming Essentials - M24 - math module
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN Golang
 
Top Libraries for Machine Learning with Python
Top Libraries for Machine Learning with Python Top Libraries for Machine Learning with Python
Top Libraries for Machine Learning with Python
 
Kotlin Coroutines and Android sitting in a tree
Kotlin Coroutines and Android sitting in a treeKotlin Coroutines and Android sitting in a tree
Kotlin Coroutines and Android sitting in a tree
 
Netflix SRE perf meetup_slides
Netflix SRE perf meetup_slidesNetflix SRE perf meetup_slides
Netflix SRE perf meetup_slides
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with Python
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Android ui menu
Android ui menuAndroid ui menu
Android ui menu
 
Github PowerPoint Final
Github PowerPoint FinalGithub PowerPoint Final
Github PowerPoint Final
 
C++ Functions
C++ FunctionsC++ Functions
C++ Functions
 
Python functions
Python functionsPython functions
Python functions
 
Prometheus Training
Prometheus TrainingPrometheus Training
Prometheus Training
 

Destacado

NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance CachingNGINX, Inc.
 
HTTP/2: Ask Me Anything
HTTP/2: Ask Me AnythingHTTP/2: Ask Me Anything
HTTP/2: Ask Me AnythingNGINX, Inc.
 
What's New in HTTP/2
What's New in HTTP/2What's New in HTTP/2
What's New in HTTP/2NGINX, Inc.
 
Maximizing PHP Performance with NGINX
Maximizing PHP Performance with NGINXMaximizing PHP Performance with NGINX
Maximizing PHP Performance with NGINXNGINX, Inc.
 
Benchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and ResultsBenchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and ResultsNGINX, Inc.
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and TuningNGINX, Inc.
 
Monitoring Highly Dynamic and Distributed Systems with NGINX Amplify
Monitoring Highly Dynamic and Distributed Systems with NGINX AmplifyMonitoring Highly Dynamic and Distributed Systems with NGINX Amplify
Monitoring Highly Dynamic and Distributed Systems with NGINX AmplifyNGINX, Inc.
 
Load Balancing and Scaling with NGINX
Load Balancing and Scaling with NGINXLoad Balancing and Scaling with NGINX
Load Balancing and Scaling with NGINXNGINX, Inc.
 
확률 통계 (파이썬)
확률 통계 (파이썬)확률 통계 (파이썬)
확률 통계 (파이썬)Yong Joon Moon
 
덤프 파일을 통한 사후 디버깅 실용 테크닉 NDC2012
덤프 파일을 통한 사후 디버깅 실용 테크닉 NDC2012덤프 파일을 통한 사후 디버깅 실용 테크닉 NDC2012
덤프 파일을 통한 사후 디버깅 실용 테크닉 NDC2012Esun Kim
 
Docker기반 분산 플랫폼
Docker기반 분산 플랫폼Docker기반 분산 플랫폼
Docker기반 분산 플랫폼SeongHyun Jeong
 
Vagrant와 chef로 개발서버 구축 자동화하기
Vagrant와 chef로 개발서버 구축 자동화하기Vagrant와 chef로 개발서버 구축 자동화하기
Vagrant와 chef로 개발서버 구축 자동화하기Arawn Park
 
Load Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXLoad Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXNGINX, Inc.
 
Nginx Testing in NAVER
Nginx Testing in NAVERNginx Testing in NAVER
Nginx Testing in NAVER형근 송
 
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!pyrasis
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at NetflixBrendan Gregg
 
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트OpenStack Korea Community
 

Destacado (19)

NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance Caching
 
HTTP/2: Ask Me Anything
HTTP/2: Ask Me AnythingHTTP/2: Ask Me Anything
HTTP/2: Ask Me Anything
 
What's New in HTTP/2
What's New in HTTP/2What's New in HTTP/2
What's New in HTTP/2
 
Maximizing PHP Performance with NGINX
Maximizing PHP Performance with NGINXMaximizing PHP Performance with NGINX
Maximizing PHP Performance with NGINX
 
Benchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and ResultsBenchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and Results
 
DNS in the Cloud
DNS in the CloudDNS in the Cloud
DNS in the Cloud
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and Tuning
 
Monitoring Highly Dynamic and Distributed Systems with NGINX Amplify
Monitoring Highly Dynamic and Distributed Systems with NGINX AmplifyMonitoring Highly Dynamic and Distributed Systems with NGINX Amplify
Monitoring Highly Dynamic and Distributed Systems with NGINX Amplify
 
How to monitor NGINX
How to monitor NGINXHow to monitor NGINX
How to monitor NGINX
 
Load Balancing and Scaling with NGINX
Load Balancing and Scaling with NGINXLoad Balancing and Scaling with NGINX
Load Balancing and Scaling with NGINX
 
확률 통계 (파이썬)
확률 통계 (파이썬)확률 통계 (파이썬)
확률 통계 (파이썬)
 
덤프 파일을 통한 사후 디버깅 실용 테크닉 NDC2012
덤프 파일을 통한 사후 디버깅 실용 테크닉 NDC2012덤프 파일을 통한 사후 디버깅 실용 테크닉 NDC2012
덤프 파일을 통한 사후 디버깅 실용 테크닉 NDC2012
 
Docker기반 분산 플랫폼
Docker기반 분산 플랫폼Docker기반 분산 플랫폼
Docker기반 분산 플랫폼
 
Vagrant와 chef로 개발서버 구축 자동화하기
Vagrant와 chef로 개발서버 구축 자동화하기Vagrant와 chef로 개발서버 구축 자동화하기
Vagrant와 chef로 개발서버 구축 자동화하기
 
Load Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXLoad Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINX
 
Nginx Testing in NAVER
Nginx Testing in NAVERNginx Testing in NAVER
Nginx Testing in NAVER
 
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at Netflix
 
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
 

Similar a WordPress + NGINX Best Practices with EasyEngine

WordPress Need For Speed
WordPress Need For SpeedWordPress Need For Speed
WordPress Need For Speedpdeschen
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINXKevin Jones
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINXNGINX, Inc.
 
10 Million hits a day with WordPress using a $15 VPS
10 Million hits a day  with WordPress using a $15 VPS10 Million hits a day  with WordPress using a $15 VPS
10 Million hits a day with WordPress using a $15 VPSPaolo Tonin
 
WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019Anam Ahmed
 
Running Node.js in Production using Passenger
Running Node.js in Production using PassengerRunning Node.js in Production using Passenger
Running Node.js in Production using Passengerdavidchubbs
 
Less and faster – Cache tips for WordPress developers
Less and faster – Cache tips for WordPress developersLess and faster – Cache tips for WordPress developers
Less and faster – Cache tips for WordPress developersSeravo
 
Django and Nginx reverse proxy cache
Django and Nginx reverse proxy cacheDjango and Nginx reverse proxy cache
Django and Nginx reverse proxy cacheAnton Pirker
 
Nginx [engine x] and you (and WordPress)
Nginx [engine x] and you (and WordPress)Nginx [engine x] and you (and WordPress)
Nginx [engine x] and you (and WordPress)Justin Foell
 
0628阙宏宇
0628阙宏宇0628阙宏宇
0628阙宏宇zhu02
 
Magento Performance Optimization 101
Magento Performance Optimization 101Magento Performance Optimization 101
Magento Performance Optimization 101Angus Li
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindSam Keen
 
PHP conference Berlin 2015: running PHP on Nginx
PHP conference Berlin 2015: running PHP on NginxPHP conference Berlin 2015: running PHP on Nginx
PHP conference Berlin 2015: running PHP on NginxHarald Zeitlhofer
 
A WordPress workshop at Cefalo
A WordPress workshop at Cefalo A WordPress workshop at Cefalo
A WordPress workshop at Cefalo Beroza Paul
 
Clug 2012 March web server optimisation
Clug 2012 March   web server optimisationClug 2012 March   web server optimisation
Clug 2012 March web server optimisationgrooverdan
 
Apache and PHP: Why httpd.conf is your new BFF!
Apache and PHP: Why httpd.conf is your new BFF!Apache and PHP: Why httpd.conf is your new BFF!
Apache and PHP: Why httpd.conf is your new BFF!Jeff Jones
 
Award-winning technology: Oxid loves the query cache
Award-winning technology: Oxid loves the query cacheAward-winning technology: Oxid loves the query cache
Award-winning technology: Oxid loves the query cacheUlf Wendel
 

Similar a WordPress + NGINX Best Practices with EasyEngine (20)

WordPress Need For Speed
WordPress Need For SpeedWordPress Need For Speed
WordPress Need For Speed
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
10 Million hits a day with WordPress using a $15 VPS
10 Million hits a day  with WordPress using a $15 VPS10 Million hits a day  with WordPress using a $15 VPS
10 Million hits a day with WordPress using a $15 VPS
 
Nginx + PHP
Nginx + PHPNginx + PHP
Nginx + PHP
 
WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019
 
Running Node.js in Production using Passenger
Running Node.js in Production using PassengerRunning Node.js in Production using Passenger
Running Node.js in Production using Passenger
 
Less and faster – Cache tips for WordPress developers
Less and faster – Cache tips for WordPress developersLess and faster – Cache tips for WordPress developers
Less and faster – Cache tips for WordPress developers
 
Django and Nginx reverse proxy cache
Django and Nginx reverse proxy cacheDjango and Nginx reverse proxy cache
Django and Nginx reverse proxy cache
 
Nginx pres
Nginx presNginx pres
Nginx pres
 
Nginx [engine x] and you (and WordPress)
Nginx [engine x] and you (and WordPress)Nginx [engine x] and you (and WordPress)
Nginx [engine x] and you (and WordPress)
 
0628阙宏宇
0628阙宏宇0628阙宏宇
0628阙宏宇
 
Wckansai 2014
Wckansai 2014Wckansai 2014
Wckansai 2014
 
Magento Performance Optimization 101
Magento Performance Optimization 101Magento Performance Optimization 101
Magento Performance Optimization 101
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
 
PHP conference Berlin 2015: running PHP on Nginx
PHP conference Berlin 2015: running PHP on NginxPHP conference Berlin 2015: running PHP on Nginx
PHP conference Berlin 2015: running PHP on Nginx
 
A WordPress workshop at Cefalo
A WordPress workshop at Cefalo A WordPress workshop at Cefalo
A WordPress workshop at Cefalo
 
Clug 2012 March web server optimisation
Clug 2012 March   web server optimisationClug 2012 March   web server optimisation
Clug 2012 March web server optimisation
 
Apache and PHP: Why httpd.conf is your new BFF!
Apache and PHP: Why httpd.conf is your new BFF!Apache and PHP: Why httpd.conf is your new BFF!
Apache and PHP: Why httpd.conf is your new BFF!
 
Award-winning technology: Oxid loves the query cache
Award-winning technology: Oxid loves the query cacheAward-winning technology: Oxid loves the query cache
Award-winning technology: Oxid loves the query cache
 

Más de NGINX, Inc.

【NGINXセミナー】 Ingressを使ってマイクロサービスの運用を楽にする方法
【NGINXセミナー】 Ingressを使ってマイクロサービスの運用を楽にする方法【NGINXセミナー】 Ingressを使ってマイクロサービスの運用を楽にする方法
【NGINXセミナー】 Ingressを使ってマイクロサービスの運用を楽にする方法NGINX, Inc.
 
【NGINXセミナー】 NGINXのWAFとは?その使い方と設定方法 解説セミナー
【NGINXセミナー】 NGINXのWAFとは?その使い方と設定方法 解説セミナー【NGINXセミナー】 NGINXのWAFとは?その使い方と設定方法 解説セミナー
【NGINXセミナー】 NGINXのWAFとは?その使い方と設定方法 解説セミナーNGINX, Inc.
 
【NGINXセミナー】API ゲートウェイとしてのNGINX Plus活用方法
【NGINXセミナー】API ゲートウェイとしてのNGINX Plus活用方法【NGINXセミナー】API ゲートウェイとしてのNGINX Plus活用方法
【NGINXセミナー】API ゲートウェイとしてのNGINX Plus活用方法NGINX, Inc.
 
Get Hands-On with NGINX and QUIC+HTTP/3
Get Hands-On with NGINX and QUIC+HTTP/3Get Hands-On with NGINX and QUIC+HTTP/3
Get Hands-On with NGINX and QUIC+HTTP/3NGINX, Inc.
 
Managing Kubernetes Cost and Performance with NGINX & Kubecost
Managing Kubernetes Cost and Performance with NGINX & KubecostManaging Kubernetes Cost and Performance with NGINX & Kubecost
Managing Kubernetes Cost and Performance with NGINX & KubecostNGINX, Inc.
 
Manage Microservices Chaos and Complexity with Observability
Manage Microservices Chaos and Complexity with ObservabilityManage Microservices Chaos and Complexity with Observability
Manage Microservices Chaos and Complexity with ObservabilityNGINX, Inc.
 
Accelerate Microservices Deployments with Automation
Accelerate Microservices Deployments with AutomationAccelerate Microservices Deployments with Automation
Accelerate Microservices Deployments with AutomationNGINX, Inc.
 
Unit 2: Microservices Secrets Management 101
Unit 2: Microservices Secrets Management 101Unit 2: Microservices Secrets Management 101
Unit 2: Microservices Secrets Management 101NGINX, Inc.
 
Unit 1: Apply the Twelve-Factor App to Microservices Architectures
Unit 1: Apply the Twelve-Factor App to Microservices ArchitecturesUnit 1: Apply the Twelve-Factor App to Microservices Architectures
Unit 1: Apply the Twelve-Factor App to Microservices ArchitecturesNGINX, Inc.
 
NGINX基本セミナー(セキュリティ編)~NGINXでセキュアなプラットフォームを実現する方法!
NGINX基本セミナー(セキュリティ編)~NGINXでセキュアなプラットフォームを実現する方法!NGINX基本セミナー(セキュリティ編)~NGINXでセキュアなプラットフォームを実現する方法!
NGINX基本セミナー(セキュリティ編)~NGINXでセキュアなプラットフォームを実現する方法!NGINX, Inc.
 
Easily View, Manage, and Scale Your App Security with F5 NGINX
Easily View, Manage, and Scale Your App Security with F5 NGINXEasily View, Manage, and Scale Your App Security with F5 NGINX
Easily View, Manage, and Scale Your App Security with F5 NGINXNGINX, Inc.
 
NGINXセミナー(基本編)~いまさら聞けないNGINXコンフィグなど基本がわかる!
NGINXセミナー(基本編)~いまさら聞けないNGINXコンフィグなど基本がわかる!NGINXセミナー(基本編)~いまさら聞けないNGINXコンフィグなど基本がわかる!
NGINXセミナー(基本編)~いまさら聞けないNGINXコンフィグなど基本がわかる!NGINX, Inc.
 
Keep Ahead of Evolving Cyberattacks with OPSWAT and F5 NGINX
Keep Ahead of Evolving Cyberattacks with OPSWAT and F5 NGINXKeep Ahead of Evolving Cyberattacks with OPSWAT and F5 NGINX
Keep Ahead of Evolving Cyberattacks with OPSWAT and F5 NGINXNGINX, Inc.
 
Install and Configure NGINX Unit, the Universal Application, Web, and Proxy S...
Install and Configure NGINX Unit, the Universal Application, Web, and Proxy S...Install and Configure NGINX Unit, the Universal Application, Web, and Proxy S...
Install and Configure NGINX Unit, the Universal Application, Web, and Proxy S...NGINX, Inc.
 
Protecting Apps from Hacks in Kubernetes with NGINX
Protecting Apps from Hacks in Kubernetes with NGINXProtecting Apps from Hacks in Kubernetes with NGINX
Protecting Apps from Hacks in Kubernetes with NGINXNGINX, Inc.
 
NGINX Kubernetes API
NGINX Kubernetes APINGINX Kubernetes API
NGINX Kubernetes APINGINX, Inc.
 
Successfully Implement Your API Strategy with NGINX
Successfully Implement Your API Strategy with NGINXSuccessfully Implement Your API Strategy with NGINX
Successfully Implement Your API Strategy with NGINXNGINX, Inc.
 
Installing and Configuring NGINX Open Source
Installing and Configuring NGINX Open SourceInstalling and Configuring NGINX Open Source
Installing and Configuring NGINX Open SourceNGINX, Inc.
 
Shift Left for More Secure Apps with F5 NGINX
Shift Left for More Secure Apps with F5 NGINXShift Left for More Secure Apps with F5 NGINX
Shift Left for More Secure Apps with F5 NGINXNGINX, Inc.
 
How to Avoid the Top 5 NGINX Configuration Mistakes.pptx
How to Avoid the Top 5 NGINX Configuration Mistakes.pptxHow to Avoid the Top 5 NGINX Configuration Mistakes.pptx
How to Avoid the Top 5 NGINX Configuration Mistakes.pptxNGINX, Inc.
 

Más de NGINX, Inc. (20)

【NGINXセミナー】 Ingressを使ってマイクロサービスの運用を楽にする方法
【NGINXセミナー】 Ingressを使ってマイクロサービスの運用を楽にする方法【NGINXセミナー】 Ingressを使ってマイクロサービスの運用を楽にする方法
【NGINXセミナー】 Ingressを使ってマイクロサービスの運用を楽にする方法
 
【NGINXセミナー】 NGINXのWAFとは?その使い方と設定方法 解説セミナー
【NGINXセミナー】 NGINXのWAFとは?その使い方と設定方法 解説セミナー【NGINXセミナー】 NGINXのWAFとは?その使い方と設定方法 解説セミナー
【NGINXセミナー】 NGINXのWAFとは?その使い方と設定方法 解説セミナー
 
【NGINXセミナー】API ゲートウェイとしてのNGINX Plus活用方法
【NGINXセミナー】API ゲートウェイとしてのNGINX Plus活用方法【NGINXセミナー】API ゲートウェイとしてのNGINX Plus活用方法
【NGINXセミナー】API ゲートウェイとしてのNGINX Plus活用方法
 
Get Hands-On with NGINX and QUIC+HTTP/3
Get Hands-On with NGINX and QUIC+HTTP/3Get Hands-On with NGINX and QUIC+HTTP/3
Get Hands-On with NGINX and QUIC+HTTP/3
 
Managing Kubernetes Cost and Performance with NGINX & Kubecost
Managing Kubernetes Cost and Performance with NGINX & KubecostManaging Kubernetes Cost and Performance with NGINX & Kubecost
Managing Kubernetes Cost and Performance with NGINX & Kubecost
 
Manage Microservices Chaos and Complexity with Observability
Manage Microservices Chaos and Complexity with ObservabilityManage Microservices Chaos and Complexity with Observability
Manage Microservices Chaos and Complexity with Observability
 
Accelerate Microservices Deployments with Automation
Accelerate Microservices Deployments with AutomationAccelerate Microservices Deployments with Automation
Accelerate Microservices Deployments with Automation
 
Unit 2: Microservices Secrets Management 101
Unit 2: Microservices Secrets Management 101Unit 2: Microservices Secrets Management 101
Unit 2: Microservices Secrets Management 101
 
Unit 1: Apply the Twelve-Factor App to Microservices Architectures
Unit 1: Apply the Twelve-Factor App to Microservices ArchitecturesUnit 1: Apply the Twelve-Factor App to Microservices Architectures
Unit 1: Apply the Twelve-Factor App to Microservices Architectures
 
NGINX基本セミナー(セキュリティ編)~NGINXでセキュアなプラットフォームを実現する方法!
NGINX基本セミナー(セキュリティ編)~NGINXでセキュアなプラットフォームを実現する方法!NGINX基本セミナー(セキュリティ編)~NGINXでセキュアなプラットフォームを実現する方法!
NGINX基本セミナー(セキュリティ編)~NGINXでセキュアなプラットフォームを実現する方法!
 
Easily View, Manage, and Scale Your App Security with F5 NGINX
Easily View, Manage, and Scale Your App Security with F5 NGINXEasily View, Manage, and Scale Your App Security with F5 NGINX
Easily View, Manage, and Scale Your App Security with F5 NGINX
 
NGINXセミナー(基本編)~いまさら聞けないNGINXコンフィグなど基本がわかる!
NGINXセミナー(基本編)~いまさら聞けないNGINXコンフィグなど基本がわかる!NGINXセミナー(基本編)~いまさら聞けないNGINXコンフィグなど基本がわかる!
NGINXセミナー(基本編)~いまさら聞けないNGINXコンフィグなど基本がわかる!
 
Keep Ahead of Evolving Cyberattacks with OPSWAT and F5 NGINX
Keep Ahead of Evolving Cyberattacks with OPSWAT and F5 NGINXKeep Ahead of Evolving Cyberattacks with OPSWAT and F5 NGINX
Keep Ahead of Evolving Cyberattacks with OPSWAT and F5 NGINX
 
Install and Configure NGINX Unit, the Universal Application, Web, and Proxy S...
Install and Configure NGINX Unit, the Universal Application, Web, and Proxy S...Install and Configure NGINX Unit, the Universal Application, Web, and Proxy S...
Install and Configure NGINX Unit, the Universal Application, Web, and Proxy S...
 
Protecting Apps from Hacks in Kubernetes with NGINX
Protecting Apps from Hacks in Kubernetes with NGINXProtecting Apps from Hacks in Kubernetes with NGINX
Protecting Apps from Hacks in Kubernetes with NGINX
 
NGINX Kubernetes API
NGINX Kubernetes APINGINX Kubernetes API
NGINX Kubernetes API
 
Successfully Implement Your API Strategy with NGINX
Successfully Implement Your API Strategy with NGINXSuccessfully Implement Your API Strategy with NGINX
Successfully Implement Your API Strategy with NGINX
 
Installing and Configuring NGINX Open Source
Installing and Configuring NGINX Open SourceInstalling and Configuring NGINX Open Source
Installing and Configuring NGINX Open Source
 
Shift Left for More Secure Apps with F5 NGINX
Shift Left for More Secure Apps with F5 NGINXShift Left for More Secure Apps with F5 NGINX
Shift Left for More Secure Apps with F5 NGINX
 
How to Avoid the Top 5 NGINX Configuration Mistakes.pptx
How to Avoid the Top 5 NGINX Configuration Mistakes.pptxHow to Avoid the Top 5 NGINX Configuration Mistakes.pptx
How to Avoid the Top 5 NGINX Configuration Mistakes.pptx
 

Último

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

WordPress + NGINX Best Practices with EasyEngine

  • 1. WordPress-NGINX Best Practices (With EasyEngine) by Rahul Bansal (rtCamp)
  • 3. The Rule! “If you can do it in NGINX, just do it in NGINX!”
  • 5. Purpose ● Best solution for serving content to non-logged in users ● Should be used instead full-page-cache from WordPress plugin
  • 6. Global Code Fragment fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m; fastcgi_cache_key "$scheme$request_method$host$request_uri"; fastcgi_cache_use_stale error updating timeout invalid_header http_500;
  • 7. Site config server { location ~ .php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_cache WORDPRESS; fastcgi_cache_valid 60m; fastcgi_cache_bypass $skip_cache; fastcgi_no_cache $skip_cache;}}
  • 8. Cache conditions set $skip_cache 0; if ($request_method = POST) { set $skip_cache 1; } if ($query_string != "") { set $skip_cache 1; } if ($request_uri ~* "/wp-admin/|/xmlrpc.php|wp- .*.php|index.php") { set $skip_cache 1; } if ($http_cookie ~* "comment_author|wordpress_[a-f0- 9]+|wordpress_logged_in") { set $skip_cache 1; }
  • 9. Cache conditions if ($request_uri ~* "/store/|/random/|/wp-admin/|...") { set $skip_cache 1; } if ($http_cookie ~* "comment_author||yummy_cookie|...") { set $skip_cache 1; } if ($remote_addr ~* "1.2.3.4") { set $skip_cache 1; }
  • 10. Caching search result pages if ($query_string != "") { set $skip_cache 1; } # for http://example.com/?s=hello if ($arg_s != "") { set $skip_cache 0; }
  • 11. Caching multiple versions of a page # Cookie Example fastcgi_cache_key "$scheme$request_method$host$request_uri$cookie_country"; # User-Agent Example set $mobile no; if ($http_user_agent ~* "iphone|android|blackberry|netfront") { set $mobile yes;} fastcgi_cache_key "$scheme$request_method$host$request_uri$mobile";
  • 12. #2. NGINX substitution module CDN & SSL Warning fix
  • 13. CDN (Origin Pull) Original URL => example.com/wp-content/uploads/hello.jpg CDN URL => cdn.example.com/wp-content/ uploads/hello.jpg sub_filter "example.com/wp-content/uploads/" "cdn.example.com/wp-content/uploads/"; sub_filter_last_modified on; sub_filter_once off;
  • 14. SSL - mixed content warning fix sub_filter "http://example.com/wp-content/" "https://example.com/wp-content/"; sub_filter_last_modified on; sub_filter_once off;
  • 15. #3. pagespeed module Reduce load time
  • 16. pagespeed module ● css/js minify & combine. ● search-replace URL for CDN ● on the fly image (lossless) compression ● lazy loading for images
  • 17. site specific filters # CSS pagespeed EnableFilters combine_css,rewrite_css; # JS pagespeed EnableFilters combine_javascript,rewrite_javascript; # Images pagespeed EnableFilters lazyload_images; pagespeed EnableFilters rewrite_images; pagespeed EnableFilters convert_jpeg_to_progressive
  • 18. pagespeed global config # Turning the module on and off pagespeed on; # Configuring PageSpeed Filters pagespeed RewriteLevel PassThrough; # Needs to exist and be writable by nginx. Use tmpfs for best performance. pagespeed FileCachePath /var/ngx_pagespeed_cache;
  • 19. #4. Upstream Module Load Balancer/Failover
  • 20. load balance mode upstream backend { ip_hash; server 1.1.1.1; server 2.2.2.2; server 2.2.2.2; }
  • 21. failover mode upstream backend { server 1.1.1.1 max_fails=3 fail_timeout=30s; server 2.2.2.2 backup; }
  • 22. Front-end site config location / { proxy_pass http://backend; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; #proxy_cache }
  • 23. Backend NGINX Config #gloabal config set_real_ip_from 9.9.9.9; real_ip_header X-Forwarded-For;
  • 24. What if load balancer fails? ● Configure backend server with NGINX in a way that it can run as standalone server ● Use DNS-based failover to switch traffic from load balancer to a backend server
  • 25. #5. Upstream mod with HHVM Speed for logged in users
  • 26. HHVM with PHP-FPM fallback upstream php { server 127.0.0.1:8000; #hhvm server 127.0.0.1:9000 backup; #php-fpm }
  • 27. More Tricks The list is endless!
  • 28. SSL and spdy #enable SSL cache ssl_session_cache shared:SSL:20m; ssl_session_timeout 10m; #enable spdy server { listen 443 ssl spdy; }
  • 29. URL Redirection #For Single URL location = /old/path { return 301 http://foo.com/new/url; } #For Complete Section location ~ /old/(.*) { return 301 http://foo.com/new/$1; }
  • 30. Security with Limit Request Module #global limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; #server location = /wp-login.php { limit_req zone=one burst=1 nodelay; include fastcgi_params; fastcgi_pass 127.0.0.1:9000; }
  • 31. Memcache/Redis - Distributed Cache ● For wordpress site is spread across multiple servers ● Only extra work is, WordPress/PHP side codes are needed to “fill” cache ● For Memcache, NGINX has a core and few third party modules ● For redis, NGINX has third party modules
  • 33. What is EasyEngine? ● A script to setup and manage multiple wordpress sites with NGINX web server ● Always up to date with best practices, including most of the stuff we discussed so far
  • 34. Getting Started #install easy-engine wget -qO ee rt.cx/ee && sudo bash ee #install nginx, php, mysql, postfix ee stack install #install WordPress on example.com ee site create example.com --wpfc
  • 35. WordPress Multisite Handling #multisite with subdirectory ee site create example.com --wpfc --wpsubdir #multisite with subdomain ee site create example.com --wpfc --wpsubdom
  • 37. EasyEngine Resources Home : http://rtcamp.com/easyengine Github : http://github.com/rtCamp/easyengine Forum : http://community.rtcamp.com/category/easyengine/
  • 38. Q&A mailto: rahul.bansal@rtcamp.com or better, join the discussion on http://community.rtcamp.com/

Notas del editor

  1. ## Propsosal can be acceesed here - https://nginx.busyconf.com/proposals/53ff8857ea96fb95ce00007e?token=54e9k8ktl54t6wfg5vyk Hello All! I am Rahul Bansal, from rtCamp, a company based in India. There are 2 parts to my presentation. In first part, I will share WordPress-Nginx best practices we have gathered over last 4 years. In second part, I will share a small project called “EasyEngine” which automates best practices that we are about to see, in first part!
  2. WordPress, as we all know, is the best blogging/CMS platform in the world, used by 20% of the sites. Nginx, again, is favorite web-server for top web-sites. So when WordPress-Nginx comes together, it’s like two best-things coming together! We are using best CMS with best web server! We might expect everything to become best automatically. But as different sites have different needs, we need to do make some changes. We are going to see few of those changes/practices, which can help most WordPress sites.
  3. Before we dive into nginx’s wonderland, let’s understand the golden rule. Many times, you will come across things that can be done by nginx modules as well as wordpress plugins. Always remember - “If you can do it in nginx, just do it in nginx!”
  4. Most WordPress sites are used as publishing platform where content is served to non-logged in users
  5. This fragment is common to all nginx sites In above 3 lines only, a lot of magic is packed! If you notice, fastcgi_cache_path is pointing to a location in /var/run - on debian this location uses tmpfs i.e memory-based storage. The power of fastcgi_cache_key will be shown shortly. The last line fastcgi_cache_use_stale tells nginx to use cached version, even if its outdated i.e. stale, if anything goes wrong with backend. There are many things that can go wrong. You can control for which errors nginx should use stale version of page. fastcgi_cache_path inactive value ensures, if a page is cached, nginx will show it for inactive duration, even if backend php-mysql is not responding. Using fastcgi_cache_use_stale we can tell nginx to serve cached version of page, even if backend php-mysql is not responding, irrespective of “inactive” value.
  6. This fragment is part of site config We will explore fastcgi_cache_bypass and fastcgi_no_cache in next slide. fastcgi_cache line specifies name of cache zone to be used for this block. fastcgi_cache_valid is duration/timeout
  7. There are certain conditions where we want nginx to skip caching First “if” block prevents caching for HTTP POST requests. Second “if” block prevents caching URL with query string Third “if” block has list of URL patterns for which caching should not be done e.g. wordpress admin area Fourth “if” block has list of Comment keys/patterns whose presence should skip cache. The first cookie-key comment_author ensures, whenever somebody leaves comment on your blog, they see “Your comment is awaiting moderation” message with their comment content. But at the same time other users will continue to see cached pages as long as they don’t comment. The cached version without “Your comment is awaiting moderation” message.
  8. We can specify “/store/” or “/random/” in request_uri pattern list. If you are running a store, say powered by WooCommerce, you can skip caching for entire “store” section. There is a wordpress-plugin which shows “random” post at “/random” URL. This can also be skipped from caching to make sure random remains random! Similarly, during development, we can add yummy_cookie to the list and use a browser addon to set that cookie for your own browser. This way you can see completely uncached site from non-logged in user’s perspective. See you don’t need to disable cache when making changes to the website!
  9. Most wordpress sites search pages can be cached, even though pages have query string You can also maintain cache for Google Analytics, Adword query string parameters. As well as any prosperity query arguments which doesn’t change outcome
  10. The key is fastcgi_cache_key! Just changed the key as per your needs. For country specific cookie, you can simply use country-cookie as part of key. If you set country-cookie to only 5 different values, then nginx will have 6 variations, 5 for 5 countries and 6th variation for when country value is blank! Of course, if you set a default value for country, then 6th variation will not be created. In case of User-Agent example, there are ton’s of them. So passing that value doesn’t make sense. Your wordpress theme has only 2 set of version - mobile and desktop. So we need something like a switch. That is what we get in this example! We use user-agent value to determine switch value and pass it to fastcgi_cookie_key
  11. Most WordPress sites uses origin pull CDN. Where a plugin is used to replace file
  12. Remember that yellow sign in browser showing mixed content warning. There could be some plugin or theme assets which may hardcoded http:// prefix Worry not! This module can fix that for you! This sub_filter can rewrite http-prefix asset URLs to https
  13. The only problem is - not all wordpress themes and plugins play safe with CSS and JS combining. So you need to test a lot. Remember to use one of method we discussed earlier to test things!
  14. This is another nginx module which can be used in many ways. A most common way is to get it involved when you are dealing with multiple servers. So let’s see that first!
  15. When you have wordpress site or network running across multiple servers, a common way to use front-nginx as load balancer. Backend servers need to have nginx but we will see shortly why its good idea to have backend server on nginx as well! In this config, all server will get equal weight i.e. equal number of requests. ip_hash line ensures that a client/visitor always connects to the same backend server.
  16. Another common mode is to have servers setup in failover mode. Most likely primary server is more powerful and so expensive. A low-cost backup server is used to ensure only high availability.
  17. In both cases, front-end nginx config will look like this. X-Forwarded-Proto is to handle SSL forwarding We can also add proxy_cache with similar conditions and magic like fastcgi_cache That way load balancer front-end nginx handles most requests on its own, without passing any load to backend servers
  18. Backend nginx config files should have a line like set_real_ip_from with front-end server IP address. This way nginx can forward actual visitor IP address to WordPress/PHP sites. set_real_ip_from requires nginx to be compiled with realip_module module
  19. Load balancer may become single-point failure. Imagine how frustrated you will feel, when all backend servers are healthy but load balancer itself is down. This is where we prefer to use DNS-based failover as last resort! You can configure DNS-based failover to route traffic to a backend-server. This is why, earlier I recommended to have nginx ready on load balancer.
  20. This is another nginx module which can be used in many ways. A most common way is to get it involved when you are dealing with multiple servers. So let’s see that first!
  21. The magic of fastcgi_cache works mostly for non-logged in users. What about logged in users? Membership sites? Big stores? Yep, WordPress or better say WooCommerce is bigger ecommerce platform than Magento in terms of number of stores. When a request hits PHP, all that nginx magic seem to disappear. This is when HHVM - a PHP implementation by Facebook comes into picture but with its own set of problem. HHVM doesn’t play nice with all WordPress themes and plugins. Worst, when it crash, it crashes hardway. It just doesn’t feel your error log with warnings but simply show “white screen of death” Here come Nginx’s upstream module to the rescue! As you can see in this config sample, we are running hhvm on port 8000 and slower but reliable PHP’s default FPM implementation on port 9000. FPM is configured as backup to HHVM. So non-cached part of site will run fast with HHVM, but when HHVM crashes, PHP-FPM will take over. In worst case, few seconds extra won’t hurt rather than showing “white screen of death” i.e. blank page!
  22. There are many reasons for a WordPress site owner to choose SSL. Till now most common reason was running e-commerce site. But these days, SEO “experts” are driving sale of SSL certificates higher. There was a time when SSL request used to cost much more. But now recommended way is to run entire site over SSL! The time saved by managing SSL related to config will be more costly than x% extra CPU cycle SSL request take!
  23. Like other things, we can cache SSL sessions also. This reduces CPU usage further!
  24. As a wordpress site grows, it ends up having some broken links as structural changes to site takes place. There are many WordPress plugins to handle redirections. When people ask me which one to use, I remind them of our golden rule! If you can get list of single URL’s prefer that, even if you have many of them. “location =” is fastest. I can say that with confidence because as a nginx user, I asked which question on nginx forum and Igor replied with this method.
  25. I choose a toughest password for my wordpress admin login. But problem is random people try to log into WordPress sites all the time, by bruteforce attack method! They are not going to succeed but their act generates load on precious php-mysql backend. And if they get greedy, then it can crash backend as well. Remember we asked fastcgi to not cache out wp-login as well as HTTP POST requests. So we need some way to limit these bruteforce attempts! That is what limit request module does for us. 10m is size of zone. 1MB can hold 16000 states. I think this means 16000 unique IP addresses. In case you have way too many sites or very high traffic sites, you may want to increase it to 20MB or 100MB. 1r/s means 1 request per second is allowed. You cannot specify fractions. If you want to slowdown further, means less requests per second try 30r/m which means 30 requests per min, effectively 1 request per 2 second (half request per second). nodelay makes sure as soon as request limit exceeds, HTTP status code 503 (Service Unavailable) is returned by default. In our case 444 will be returned.
  26. Finally we are in second part. This will be short. Because everything is easy here.
  27. Once you get a shell access to a VPS/dedicated server, preferably fresh one all you need is to run 3 commands. The first command install easy-engine itself. Second command, installs nginx with all required module including pagespeed, latest php and hhvm also, mysql and other dependencies Third command will create a wordpress site for domain example.com with nginx’s fastcgi-cache. The site will have nginx limit module’s bruteforce protection, increased PHP file upload limit, tweaked nginx, php, mysql config based on available RAM and much more. It can also setup turn on nginx upstream block with hhvm with php-fpm fallback. EE also installs nginx-helper.
  28. WordPress Multisite setup, specially multisiste with subdirectory needs customized nginx config. EasyEngine can handle that for you with its simple commands. And by the way --wpfc is optional.
  29. Live demo of EasyEngine in 8-10 minutes
  30. Live demo of EasyEngine in 8-10 minutes