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.
This commit is contained in:
Oliver Davies 2022-08-17 22:58:42 +01:00
parent fc325ec947
commit c96c8be84c

View file

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