Skip to content

Instantly share code, notes, and snippets.

@marcozink
Forked from wsaribeiro/nginx.conf
Created June 22, 2018 05:13
Show Gist options
  • Save marcozink/975759ddde776a96ee6304c711b3ea48 to your computer and use it in GitHub Desktop.
Save marcozink/975759ddde776a96ee6304c711b3ea48 to your computer and use it in GitHub Desktop.
NGINX Configuration for WordPress Multisite + Domain Mapping with HTTPS
server {
listen 80 default_server deferred;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl spdy deferred;
# Main site domain
server_name example.com *.example.com;
# Uncomment the following line for Domain Mapping (WP Multisite)
server_name_in_redirect off;
ssl on;
server_tokens off;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/letsencrypt/live/example.com/chain.pem;
ssl_dhparam /etc/ssl/dhparam.pem;
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
access_log /var/log/nginx/example.com.access.log rt_cache;
error_log /var/log/nginx/example.com.error.log;
root /var/www/example.com/htdocs;
index index.php index.html index.htm;
# Custom nginx.conf
include /var/www/example.com/conf/nginx/*.conf;
# WordPress nginx config rules
include common/wpfc-hhvm.conf;
include common/wpsubdir.conf;
include common/wpcommon.conf;
include common/locations.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment