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; + } +}