WP-Nginx is a model of Nginx configuration for your WordPress website using SSL Letsencrypt.
The configuration was created and is maintained by Nicolas Jamet (@neodern).
This configuration file has been tested on Debian 7 and SSL certificates generated by Certbot. Feel free to fork this project and send a PR with your optimisations or contact me. ;)
- Step 1 : replace all
exemple.com
with your domain name. - Step 2 : Edit values below
set $wpn_yoast_seo_plugin 1; # set to 0 if you don't use YOAST SEO Plugin, but you should use it. ;)
# Basic configuration
server_name www.exemple.com;
root /var/www/site-directory/;
index index.php;
# Logs
access_log /var/log/exemple.access.log;
error_log /var/log/exemple.error.log;
# SSL public and private keys
ssl_certificate /etc/letsencrypt/live/www.exemple.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.exemple.com/privkey.pem;
##
# Rocket-Nginx configuration
##
# Uncomment it if you use wp-rocket Plugin and rocket-nginx configuration
# wp-rocket : https://wp-rocket.me/
# rocket-nginx : https://github.com/maximejobin/rocket-nginx
##
#include rocket-nginx/rocket-nginx.conf;
Released under the MIT. See the link for details.