Skip to content

Instantly share code, notes, and snippets.

@ngstigator
Last active October 8, 2020 23:13
Show Gist options
  • Save ngstigator/f1ab2ce8ba1afc26a6d06ce2c1438b32 to your computer and use it in GitHub Desktop.
Save ngstigator/f1ab2ce8ba1afc26a6d06ce2c1438b32 to your computer and use it in GitHub Desktop.
works with WP and Grav
server {
listen 80; ## listen for ipv4; this line is default and implied
listen 443 ssl;
root /home/PATH/public_html;
index index.php index.html index.htm;
server_name DOMAINNAME.ca;
ssl_certificate /etc/letsencrypt/live/DOMAINNAME.ca/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/DOMAINNAME.ca/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_dhparam /etc/nginx/ssl/dhparams.pem;
access_log /var/log/nginx/DOMAINNAME-ca-access.log;
error_log /var/log/nginx/DOMAINNAME-ca-error.log;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
fastcgi_read_timeout 600;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
client_max_body_size 100m;
}
# Let's Encrypt
location ~ /.well-known {
allow all;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 365d;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment