-
-
Save wsaribeiro/34cb02b5a7695994ebf0e91b30fc9f0c to your computer and use it in GitHub Desktop.
NGINX Configuration for WordPress Multisite + Domain Mapping with HTTPS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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