From fe355027ea21f6bade0012cbb1269e18f6043cba Mon Sep 17 00:00:00 2001 From: Riccardo Di Dato Date: Sat, 23 Sep 2023 11:14:40 +0200 Subject: [PATCH] Nginx redirect non www to www --- cicd/nginx/nginx.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cicd/nginx/nginx.conf b/cicd/nginx/nginx.conf index 4920bd5..aa628b0 100644 --- a/cicd/nginx/nginx.conf +++ b/cicd/nginx/nginx.conf @@ -5,12 +5,25 @@ events { worker_connections 1024; } http { client_max_body_size 5M; + server { + listen 80; + server_name fattidinapoli.it; + return 301 https://www.fattidinapoli.it$request_uri; + } + + server { + listen 443 ssl; + server_name fattidinapoli.it; + return 301 https://www.fattidinapoli.it$request_uri; + } + server { listen 80; server_name www.ifattidinapoli.it preproduction.ifattidinapoli.it; return 301 https://$host$request_uri; } + server { listen 443 ssl;