Skip to content
Snippets Groups Projects
Commit 6483e99f authored by Alessandro Cerioni's avatar Alessandro Cerioni
Browse files

Update nginx.conf.template, in order to make Matomo be loaded for both the EN and FR versions.

N.B.: Before this update, Matomo was only loaded for the EN version.
parent 176dd9df
Branches
No related tags found
No related merge requests found
Pipeline #
...@@ -21,10 +21,8 @@ server { ...@@ -21,10 +21,8 @@ server {
})(); })();
</script>"; </script>";
sub_filter '</head>' '$matomo_script</head>';
# rule redirecting to fr or en regarding the browser preferences # rule redirecting to fr or en regarding the browser preferences
location = / { location / {
rewrite_by_lua ' rewrite_by_lua '
for lang in (ngx.var.http_accept_language .. ","):gmatch("([^,]*),") do for lang in (ngx.var.http_accept_language .. ","):gmatch("([^,]*),") do
if string.sub(lang, 0, 2) == "en" then if string.sub(lang, 0, 2) == "en" then
...@@ -41,16 +39,18 @@ server { ...@@ -41,16 +39,18 @@ server {
# This is needed to allow reloading in the app when not on the base url as our app is an SPA # This is needed to allow reloading in the app when not on the base url as our app is an SPA
location /en { location /en {
try_files $uri$args /en/index.html; try_files $uri$args /en/index.html;
sub_filter '</head>' '$matomo_script</head>';
} }
location /fr { location /fr {
try_files $uri$args /fr/index.html; try_files $uri$args /fr/index.html;
sub_filter '</head>' '$matomo_script</head>';
sub_filter '<html lang="en">' '<html lang="fr">'; sub_filter '<html lang="en">' '<html lang="fr">';
} }
# Allow to access the app without the /fr or /en and will by default redirect to /en/{path} # Allow to access the app without the /fr or /en and will by default redirect to /en/{path}
location / { #location / {
try_files $uri$args /en/index.html; # try_files $uri$args /en/index.html;
} #}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment