diff --git a/hydra/nginx/berlin.scm b/hydra/nginx/berlin.scm index 303fd35..7e329fc 100644 --- a/hydra/nginx/berlin.scm +++ b/hydra/nginx/berlin.scm @@ -468,6 +468,10 @@ PUBLISH-URL." (uri "/guix") (body (list "root /var/www;"))) + (nginx-location-configuration + (uri "~ (.html|.htm)$") + (body (list "try_files /$lang/$uri $uri =404;"))) + (nginx-location-configuration ;certbot (uri "/.well-known") (body (list "root /var/www;"))))) @@ -514,6 +518,8 @@ PUBLISH-URL." (locations guix.gnu.org-locations) (raw-content (list + "rewrite (.*)/$ $1/index.html;" + "set_from_accept_language $lang en de;" "access_log /var/log/nginx/guix-info.access.log;"))) (nginx-server-configuration @@ -525,6 +531,8 @@ PUBLISH-URL." (append %tls-settings (list + "rewrite (.*)/$ $1/index.html;" + "set_from_accept_language $lang en de;" "access_log /var/log/nginx/guix-info.https.access.log;")))) (nginx-server-configuration @@ -621,6 +629,8 @@ PUBLISH-URL." (append %tls-settings (list + "rewrite (.*)/$ $1/index.html;" + "set_from_accept_language $lang en de;" "access_log /var/log/nginx/guix-info.https.access.log;")))) (nginx-server-configuration @@ -634,6 +644,8 @@ PUBLISH-URL." (append %tls-settings (list + "rewrite (.*)/$ $1/index.html;" + "set_from_accept_language $lang en de;" "access_log /var/log/nginx/guix-gnu-org.https.access.log;")))) (nginx-server-configuration @@ -775,6 +787,11 @@ PUBLISH-URL." (define %nginx-configuration (nginx-configuration (server-blocks %berlin-servers) + (modules + (list + ;; Module to redirect users to the localized pages of their choice. + (file-append nginx-accept-language-module + "/etc/nginx/modules/ngx_http_accept_language_module.so"))) (global-directives ;; This is a 72-core machine, but let's not use all of them for nginx. '((worker_processes . 16)