certificates work

This commit is contained in:
Jamie Curnow
2019-08-17 19:01:00 +10:00
committed by Jamie Curnow
parent cf417fb658
commit 3a9fc8e2ea
12 changed files with 511 additions and 109 deletions

View File

@ -1,4 +1,4 @@
{% if caching_enabled == 1 or caching_enabled == true -%}
# Asset Caching
include conf.d/include/assets.conf;
{%- endif %}
{% endif %}

View File

@ -1,12 +1,10 @@
{%- if certificate and certificate_id > 0 -%}
{%- if certificate.provider == "letsencrypt" %}
{% if certificate and certificate_id > 0 -%}
{% if certificate.provider == "letsencrypt" %}
# Let's Encrypt SSL
include conf.d/include/letsencrypt-acme-challenge.conf;
include conf.d/include/ssl-ciphers.conf;
ssl_certificate /etc/letsencrypt/live/npm-{{ certificate.id }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/npm-{{ certificate.id }}/privkey.pem;
{%- endif -%}
ssl_certificate /etc/letsencrypt/live/npm-{{ certificate_id }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/npm-{{ certificate_id }}/privkey.pem;
{% endif %}
# TODO: Custom SSL paths
{%- endif %}
{% endif %}

View File

@ -1,4 +1,4 @@
{% if block_exploits == 1 or block_exploits == true -%}
{% if block_exploits == 1 or block_exploits == true %}
# Block Exploits
include conf.d/include/block-exploits.conf;
{%- endif -%}
{% endif %}

View File

@ -1,6 +1,6 @@
{%- if certificate and certificate_id > 0 -%}
{%- if ssl_forced == 1 or ssl_forced == true -%}
{% if certificate and certificate_id > 0 -%}
{% if ssl_forced == 1 or ssl_forced == true %}
# Force SSL
include conf.d/include/force-ssl.conf;
{%- endif -%}
{%- endif %}
{% endif %}
{% endif %}

View File

@ -1,3 +1,3 @@
# ------------------------------------------------------------
# {{ domain_names | join: ", " }}
# ------------------------------------------------------------
# ------------------------------------------------------------

View File

@ -1,5 +1,5 @@
listen 80;
{%- if certificate -%}
{% if certificate -%}
listen 443 ssl;
{%- endif %}
server_name {{ domain_names | join: " " }};
{% endif %}
server_name {{ domain_names | join: " " }};

View File

@ -0,0 +1,14 @@
{% include "_header_comment.conf" %}
server {
listen 80;
server_name {{ domain_names | join: " " }};
access_log /data/logs/letsencrypt-requests.log proxy;
include conf.d/include/letsencrypt-acme-challenge.conf;
location / {
return 404;
}
}