用nginx_accept_language_module将语言列表replace为一个variables

我有一个网站。 我的网站根目录的语言部分:

location ~ ^/(ar|en|es|pl) { rewrite ^/(.*)(/+)$ /$1 permanent; root /var/www/mysite.com/cache/webpages; try_files $uri.html /index.php?path=$uri; } 

例如,我已经看到这个:

 set_from_accept_language $lang en ja pl; where $lang is the variable in which to store the locale and en ja pl are the locales supported by the website. If none of the locales from accept_language is available on your website, the variable (here, $lang) is set to the first locale in the list (here, en). 

从https://www.nginx.com/resources/wiki/modules/accept_language/

好吧,我试图用这个:

 set_from_accept_language $lang ar en es pl; location ~ ^/ { rewrite ^/(.*)(/+)$ /$lang permanent; root /var/www/mysite.com/cache/webpages; try_files $uri.html /index.php?path=$uri; } 

结果我收到错误:

Starting nginx: nginx: [emerg] variable already defined: "lang" in /etc/nginx/mysite.conf:58

也许我不明白的东西,你能帮助我,如何解决这个问题? 如何将语言列表分配给variables?