From aed24fedf2aaba031bebc5d8d616bcb2928d8d5c Mon Sep 17 00:00:00 2001 From: EwelinaSkrzypacz Date: Tue, 19 Nov 2024 08:54:44 +0100 Subject: [PATCH] - wip --- environment/prod/app/nginx.conf | 36 +++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/environment/prod/app/nginx.conf b/environment/prod/app/nginx.conf index 3ae0b523..19d0d12f 100644 --- a/environment/prod/app/nginx.conf +++ b/environment/prod/app/nginx.conf @@ -22,6 +22,11 @@ http { sendfile on; keepalive_timeout 65; + map $http_accept_language $lang { + default pl; + ~en en; + } + server { listen 80 default; server_name blumilk-website-nginx; @@ -32,10 +37,33 @@ http { root /application/public; index index.php; - rewrite ^/partnerships$ https://www.blumilk.pl/ permanent; - rewrite ^/services https://www.blumilk.pl/ permanent; - rewrite ^/privacy https://www.blumilk.pl/pl/polityka-prywatnosci permanent; - rewrite ^/company https://www.blumilk.pl/pl/dane-firmy permanent; + location = /privacy { + if ($lang = pl) { + return 301 /pl/polityka-prywatnosci; + } + + if ($lang = en) { + return 301 /en/privacy-policy; + } + } + + location = /company { + if ($lang = pl) { + return 301 /pl/polityka-prywatnosci; + } + + if ($lang = en) { + return 301 /en/privacy-policy; + } + } + + location = /partnerships { + return 301 /; + } + + location = /services { + return 301 /; + } if (!-e $request_filename) { rewrite ^.*$ /index.php last;