Welcome! Log In Create A New Profile

Advanced

Re: $server protocol попадает в location, почему так?

February 10, 2015 04:57AM
Да, похоже на указанный баг.

nginx version: nginx/1.6.2

В продакшене только стабильные версии.

Вот локейшен

location ~ '^/(?<lang_code>[\D-]{2})/(?<rest_uri>.*)' {

# Redirect to Russian for some CIS countries
if ($lang_code ~* (uk|be|kk)) {
return 301 https://$host/ru/$rest_uri$is_args$args;
}
# Redirect to Norwegian for Nordic countries
if ($lang_code ~* (sv|da)) {
return 301 https://$host/no/$rest_uri$is_args$args;
}

# Redirect to English for unknown languages
if ($lang_code !~* (en|no|ru)) {
return 301 https://$host/en/$rest_uri$is_args$args;
}

if ($args ~ (.*)locale=[^&]*(.*)) {
set $args $1$2;
}
# cleanup any repeated & introduced
if ($args ~ (.*)&&+(.*)) {
set $args $1&$2;
}
# cleanup leading &
if ($args ~ ^&(.*)) {
set $args $1;
}
# cleanup ending &
if ($args ~ (.*)&$) {
set $args $1;
}

if ($cookie_lang = "") {
add_header Set-Cookie 'lang=$lang_code;Domain=.infoss.no;Path=/;Max-Age=315360';
}
if ($cookie_lang !~ $lang_code) {
add_header Set-Cookie 'lang=$lang_code;Domain=.infoss.no;Path=/;Max-Age=315360';
}
alias /var/www/infoss/$lang_code/vpnbox/$rest_uri$is_args$args;
index index.html;
}
Subject Author Posted

Re: $server protocol попадает в location, почему так?

Vadim Lazovskiy February 10, 2015 03:16AM

Re: $server protocol попадает в location, почему так?

Maximus43 February 10, 2015 04:57AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 109
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready