summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 }};