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;