From 87f7191ebf95c2737d8ad52c3611570529c3b346 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 21 Jul 2022 21:07:59 +0100 Subject: [PATCH] chore: update Nginx vhost --- nginx/oliverdavies.uk.conf | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/nginx/oliverdavies.uk.conf b/nginx/oliverdavies.uk.conf index 72b478b1..0d8a4618 100644 --- a/nginx/oliverdavies.uk.conf +++ b/nginx/oliverdavies.uk.conf @@ -391,12 +391,33 @@ map $uri $new_uri { } server { - listen 8080; + listen 80 default_server; + + server_name _; + + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl; + server_name oliverdavies.uk; + ssl_certificate /home/opdavies/.acme.sh/www.oliverdavies.uk/www.oliverdavies.uk.cer; + ssl_certificate_key /home/opdavies/.acme.sh/www.oliverdavies.uk/www.oliverdavies.uk.key; + return 301 $scheme://www.oliverdavies.uk$request_uri; +} + +server { + listen 443 ssl; + + server_name www.oliverdavies.uk; root /srv/oliverdavies.uk; index index.html; error_page 404 /404.html; + ssl_certificate /home/opdavies/.acme.sh/www.oliverdavies.uk/www.oliverdavies.uk.cer; + ssl_certificate_key /home/opdavies/.acme.sh/www.oliverdavies.uk/www.oliverdavies.uk.key; + location / { try_files $uri $uri.html $uri/index.html =404; }