From e4d3322ccaf40b0bde262a9a22e994e8ca3fc437 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 24 Dec 2020 01:41:58 +0100 Subject: [PATCH] c3woc.cn --- host_vars/web01.l3d.space.yml | 2 ++ templates/files/nginx/sites/c3woc.cn_tls.conf | 14 ++++++++++++++ templates/files/nginx/sites/c3woc.eu_tls.conf | 4 +--- templates/files/nginx/sites/www.c3woc.cn_tls.conf | 14 ++++++++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 templates/files/nginx/sites/c3woc.cn_tls.conf create mode 100644 templates/files/nginx/sites/www.c3woc.cn_tls.conf diff --git a/host_vars/web01.l3d.space.yml b/host_vars/web01.l3d.space.yml index c2239e6..5cc0158 100644 --- a/host_vars/web01.l3d.space.yml +++ b/host_vars/web01.l3d.space.yml @@ -27,6 +27,8 @@ nginx_sites: - name: 'www.c3woc.org' - name: 'c3woc.eu' - name: 'www.c3woc.eu' + - name: 'c3woc.cn' + - name: 'www.c3woc.cn' acme_notification_email: "acme_{{ inventory_hostname }}@l3d.yt" diff --git a/templates/files/nginx/sites/c3woc.cn_tls.conf b/templates/files/nginx/sites/c3woc.cn_tls.conf new file mode 100644 index 0000000..60734a6 --- /dev/null +++ b/templates/files/nginx/sites/c3woc.cn_tls.conf @@ -0,0 +1,14 @@ +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name c3woc.cn; + + include snippets/tls_parameters_{{ site.name }}.snippet.conf; + include snippets/tls_certificate_{{ site.name }}.snippet.conf; + include snippets/logging_{{ site.name }}.snippet.conf; + + location / { + return 308 https://c3woc.org$request_uri; + } +} diff --git a/templates/files/nginx/sites/c3woc.eu_tls.conf b/templates/files/nginx/sites/c3woc.eu_tls.conf index dc1e4d5..2062fdd 100644 --- a/templates/files/nginx/sites/c3woc.eu_tls.conf +++ b/templates/files/nginx/sites/c3woc.eu_tls.conf @@ -8,9 +8,7 @@ server { include snippets/tls_certificate_{{ site.name }}.snippet.conf; include snippets/logging_{{ site.name }}.snippet.conf; - root /srv/www/c3woc.org; - location / { - try_files $uri $uri/ =404; + return 308 https://c3woc.org$request_uri; } } diff --git a/templates/files/nginx/sites/www.c3woc.cn_tls.conf b/templates/files/nginx/sites/www.c3woc.cn_tls.conf new file mode 100644 index 0000000..2565586 --- /dev/null +++ b/templates/files/nginx/sites/www.c3woc.cn_tls.conf @@ -0,0 +1,14 @@ +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name www.c3woc.cn; + + include snippets/tls_parameters_{{ site.name }}.snippet.conf; + include snippets/tls_certificate_{{ site.name }}.snippet.conf; + include snippets/logging_{{ site.name }}.snippet.conf; + + location / { + return 308 https://c3woc.org$request_uri; + } +}