Created
May 19, 2020 11:33
-
-
Save geekykant/281d52a163b740a47d32272a3520745d to your computer and use it in GitHub Desktop.
Cloudflare + Nginx (DigitalOcean Setup)
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; | |
listen [::]:80 default_server ipv6only=on; | |
listen 443 ssl; #Make sure to set SSL to (Strict) in Clouflare menu | |
root /var/www/html; | |
index index.php; | |
server_name example.com www.example.com; | |
#Configure this cloudflare Certificates | |
ssl_certificate /etc/ssl/cloudflare/cert.pem; | |
ssl_certificate_key /etc/ssl/cloudflare/key.pem; | |
#Wordpress config (PHP7.2) | |
location / { | |
try_files $uri $uri/ /index.php?$args; | |
} | |
location ~ \.php$ { | |
include snippets/fastcgi-php.conf; | |
fastcgi_pass unix:/run/php/php7.2-fpm.sock; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment