gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-deployment] branch master updated: nginx: taler.net:


From: gnunet
Subject: [GNUnet-SVN] [taler-deployment] branch master updated: nginx: taler.net: redirect based on accept-language header
Date: Fri, 20 Jan 2017 00:05:46 +0100

This is an automated email from the git hooks/post-receive script.

tg pushed a commit to branch master
in repository deployment.

The following commit(s) were added to refs/heads/master by this push:
     new 6f2749e  nginx: taler.net: redirect based on accept-language header
6f2749e is described below

commit 6f2749e4c45f7d985d2998500215bc78ec9c5523
Author: tg(x) <address@hidden>
AuthorDate: Fri Jan 20 00:07:15 2017 +0100

    nginx: taler.net: redirect based on accept-language header
---
 etc/nginx/nginx.conf                 |  2 ++
 etc/nginx/sites-enabled/www-ssl.site | 23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf
index 732400e..cc74255 100644
--- a/etc/nginx/nginx.conf
+++ b/etc/nginx/nginx.conf
@@ -2,6 +2,8 @@ user www-data;
 worker_processes 4;
 pid /var/run/nginx.pid;
 
+include /etc/nginx/modules-enabled/*.conf;
+
 events {
        worker_connections 768;
        # multi_accept on;
diff --git a/etc/nginx/sites-enabled/www-ssl.site 
b/etc/nginx/sites-enabled/www-ssl.site
index adc2df0..13e5864 100644
--- a/etc/nginx/sites-enabled/www-ssl.site
+++ b/etc/nginx/sites-enabled/www-ssl.site
@@ -9,6 +9,29 @@ server {
        server_name www.taler.net;
        include conf.d/talerssl;
 
+        location = / {
+            rewrite_by_lua '
+              for lang in (ngx.var.http_accept_language .. 
","):gmatch("([^,]*),") do
+                if string.sub(lang, 0, 2) == "en" then
+                  ngx.redirect("/en/")
+                end
+                if string.sub(lang, 0, 2) == "de" then
+                  ngx.redirect("/de/")
+                end
+                if string.sub(lang, 0, 2) == "fr" then
+                  ngx.redirect("/fr/")
+                end
+                if string.sub(lang, 0, 2) == "it" then
+                  ngx.redirect("/it/")
+                end
+                if string.sub(lang, 0, 2) == "es" then
+                  ngx.redirect("/es/")
+                end
+              end
+              ngx.redirect("/en/")
+            ';
+        }
+
        location / {
            root /var/www/taler.net;
            autoindex off;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]