Permalink
Browse files

added deployment of nginx configs for Let's Encrypt

  • Loading branch information...
AdnanHodzic committed Mar 9, 2018
1 parent f336f6f commit 608ec68bb05ab1ee6226ab8e90575ddd534b536e
Showing with 56 additions and 0 deletions.
  1. +12 −0 templates/domain.conf.j2
  2. +44 −0 templates/domain.conf.ssl.j2
View
@@ -0,0 +1,12 @@
server {
listen 80;
server_name <%= domain.name %>;
location / {
return 301 https://$server_name$request_uri;
}
# This helper sets up the path for the ACME server to verify that you own the site
# Defaults to /.well-known/acme-challenge/
<%= acme_challenge_location %>
}
@@ -0,0 +1,44 @@
server {
listen 443 ssl http2;
# domain.name will be "my.example.com", you can also hard-code it.
server_name <%= domain.name %>;
# wordpress root
root /var/www/html;
index index.php;
ssl on;
ssl_certificate <%= domain.chained_cert_path %>;
ssl_certificate_key <%= domain.key_path %>;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_cache shared:SSL:50m;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA;
ssl_prefer_server_ciphers on;
ssl_dhparam <%= dhparam_path %>;
location / {
return 301 <%= domain.upstream %>;
# Or if you want to hard-code it
# return 301 https://letsencrypt.org;
location / {
try_files $uri $uri/ /index.php?$args;
}
# wordpress php-fpm
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass wordpress:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
}

0 comments on commit 608ec68

Please sign in to comment.