From af71f4ebcf5f21fb7ea4b3b69faceed110339d31 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sun, 29 Jan 2023 21:40:14 +1100 Subject: [PATCH] Update nginx conf --- config/nginx.conf | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/config/nginx.conf b/config/nginx.conf index 09b95e4..ecbdbd4 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -1,9 +1,8 @@ upstream blog { - server unix:///home/blog/shared/tmp/sockets/puma.sock; + server 0.0.0.0:2300; } server { - listen 80; server_name dnitza.com; # ~2 seconds is often enough for most folks to parse HTML/CSS and @@ -12,7 +11,7 @@ server { keepalive_timeout 5; # path for static files - root /home/blog/public; + root /home/blog/current/public; access_log /home/blog/shared/log/nginx.access.log; error_log /home/blog/shared/log/nginx.error.log info; @@ -71,4 +70,23 @@ server { location = /500.html { root /home/blog/current/public; } + + listen 443 ssl; # managed by Certbot + ssl_certificate /etc/letsencrypt/live/dnitza.com-0002/fullchain.pem; # managed by Certbot + ssl_certificate_key /etc/letsencrypt/live/dnitza.com-0002/privkey.pem; # managed by Certbot + include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot + +} + + +server { + if ($host = dnitza.com) { + return 301 https://$host$request_uri; + } # managed by Certbot + + + listen 80; + server_name dnitza.com; + return 404; # managed by Certbot }