summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Porte <microjoe@microjoe.org>2020-05-07 06:57:04 +0200
committerRomain Porte <microjoe@microjoe.org>2020-05-07 06:57:04 +0200
commit4e92ccfc7f2cc9bfb91463911c2073b62f25e4d2 (patch)
treee61708fbb122f7a59193ab7d926561872bbe1742
parent3e8871aed1bc147931fd0cc5da3ecda452c9cb39 (diff)
downloadMicroJoe.nginx-staticwebsite-4e92ccfc7f2cc9bfb91463911c2073b62f25e4d2.tar.gz
MicroJoe.nginx-staticwebsite-4e92ccfc7f2cc9bfb91463911c2073b62f25e4d2.zip
remove letsencrypt_activate, rename letsencrypt_https -> nginx_ssl
-rw-r--r--defaults/main.yml3
-rw-r--r--templates/nginx.j24
2 files changed, 2 insertions, 5 deletions
diff --git a/defaults/main.yml b/defaults/main.yml
index 4ce5626..ab9655a 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -11,8 +11,7 @@ nginx_enable_http2: true
nginx_cache_static: true
letsencrypt_wellknown: /var/www/letsencrypt
-letsencrypt_activate: true
-letsencrypt_https: true
+nginx_ssl: false
letsencrypt_domain: "{{ nginx_domain }}"
upload_user: ssh-http-upload
diff --git a/templates/nginx.j2 b/templates/nginx.j2
index 0e05c02..749c4ba 100644
--- a/templates/nginx.j2
+++ b/templates/nginx.j2
@@ -8,12 +8,11 @@ server {
access_log /var/log/nginx/{{ nginx_domain }}.access.log;
error_log /var/log/nginx/{{ nginx_domain }}.error.log;
-{% if letsencrypt_activate %}
location ^~ /.well-known/acme-challenge {
root {{ letsencrypt_wellknown }};
}
-{% if letsencrypt_https %}
+{% if nginx_ssl %}
location / {
rewrite ^(.*)$ https://{{ nginx_domain }}$1 permanent;
}
@@ -34,7 +33,6 @@ server {
include /etc/nginx/snippets/ssl.conf;
{% endif %}
-{% endif %}
root {{ nginx_root }};