From c96c8be84c2920e1f75728aa5a9bdcb3f6f53948 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 17 Aug 2022 22:58:42 +0100 Subject: [PATCH] chore(nginx): simplify vhost configuration Simplify the vhost configuration now that Caddy is sitting in front of Nginx again. This means that Caddy is responsible for the SSL certificate generation and configuration, and proxying requests to Nginx, which is responsible for processing the redirect map and serving the static files from disk. This is a temporary solution until I can get the redirects working in the same way with Caddy. --- nginx/oliverdavies.uk.conf | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/nginx/oliverdavies.uk.conf b/nginx/oliverdavies.uk.conf index 08304551..9fa3b7f2 100644 --- a/nginx/oliverdavies.uk.conf +++ b/nginx/oliverdavies.uk.conf @@ -394,23 +394,7 @@ map $uri $new_uri { } server { - 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; + listen 8080; server_name www.oliverdavies.uk; root /srv/oliverdavies.uk; @@ -418,9 +402,6 @@ server { 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; }