From 8e055431d32d60591918599862b303b565ece80c Mon Sep 17 00:00:00 2001 From: EwelinaSkrzypacz Date: Tue, 19 Nov 2024 07:33:16 +0100 Subject: [PATCH 1/6] - wip --- environment/prod/app/nginx.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/environment/prod/app/nginx.conf b/environment/prod/app/nginx.conf index 46c52ae8..c326b44a 100644 --- a/environment/prod/app/nginx.conf +++ b/environment/prod/app/nginx.conf @@ -32,6 +32,11 @@ 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; + if (!-e $request_filename) { rewrite ^.*$ /index.php last; } From d127c680a03f92d47b927c89b8e9cdf1f733299a Mon Sep 17 00:00:00 2001 From: EwelinaSkrzypacz Date: Tue, 19 Nov 2024 07:59:22 +0100 Subject: [PATCH 2/6] - wip --- environment/prod/app/nginx.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/environment/prod/app/nginx.conf b/environment/prod/app/nginx.conf index c326b44a..3ae0b523 100644 --- a/environment/prod/app/nginx.conf +++ b/environment/prod/app/nginx.conf @@ -32,10 +32,10 @@ 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; + 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; if (!-e $request_filename) { rewrite ^.*$ /index.php last; From aed24fedf2aaba031bebc5d8d616bcb2928d8d5c Mon Sep 17 00:00:00 2001 From: EwelinaSkrzypacz Date: Tue, 19 Nov 2024 08:54:44 +0100 Subject: [PATCH 3/6] - 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; From a9d9f6082c46e86528759ef47e5df2db439c7436 Mon Sep 17 00:00:00 2001 From: EwelinaSkrzypacz Date: Tue, 19 Nov 2024 09:00:06 +0100 Subject: [PATCH 4/6] - wip --- environment/prod/app/nginx.conf | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/environment/prod/app/nginx.conf b/environment/prod/app/nginx.conf index 19d0d12f..ed96adbc 100644 --- a/environment/prod/app/nginx.conf +++ b/environment/prod/app/nginx.conf @@ -37,33 +37,10 @@ http { root /application/public; index index.php; - 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 /; - } + 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; if (!-e $request_filename) { rewrite ^.*$ /index.php last; From 23561bff0f012dc4f04e8f7c313553958042dc28 Mon Sep 17 00:00:00 2001 From: EwelinaSkrzypacz Date: Tue, 19 Nov 2024 10:49:38 +0100 Subject: [PATCH 5/6] - trying to redirect --- environment/prod/app/nginx.conf | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/environment/prod/app/nginx.conf b/environment/prod/app/nginx.conf index ed96adbc..8b32503e 100644 --- a/environment/prod/app/nginx.conf +++ b/environment/prod/app/nginx.conf @@ -10,6 +10,11 @@ events { worker_connections 1024; } +map $http_accept_language $user_language { + default en; + ~^pl pl; +} + http { include /etc/nginx/mime.types; default_type application/octet-stream; @@ -22,11 +27,6 @@ http { sendfile on; keepalive_timeout 65; - map $http_accept_language $lang { - default pl; - ~en en; - } - server { listen 80 default; server_name blumilk-website-nginx; @@ -37,10 +37,12 @@ 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 ($user_language = "pl") { + return 301 /pl/polityka-prywatnosci; + } + return 301 /en/privacy-policy; + } if (!-e $request_filename) { rewrite ^.*$ /index.php last; From 4358d03a6e057bcc3664b714f11f44a88be3cfdd Mon Sep 17 00:00:00 2001 From: EwelinaSkrzypacz Date: Tue, 19 Nov 2024 11:11:13 +0100 Subject: [PATCH 6/6] -trying to redirect --- environment/prod/app/nginx.conf | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/environment/prod/app/nginx.conf b/environment/prod/app/nginx.conf index 8b32503e..3ae0b523 100644 --- a/environment/prod/app/nginx.conf +++ b/environment/prod/app/nginx.conf @@ -10,11 +10,6 @@ events { worker_connections 1024; } -map $http_accept_language $user_language { - default en; - ~^pl pl; -} - http { include /etc/nginx/mime.types; default_type application/octet-stream; @@ -37,12 +32,10 @@ http { root /application/public; index index.php; - location = /privacy { - if ($user_language = "pl") { - return 301 /pl/polityka-prywatnosci; - } - return 301 /en/privacy-policy; - } + 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; if (!-e $request_filename) { rewrite ^.*$ /index.php last;