Welcome! Log In Create A New Profile

Advanced

Re: proxy if cookie + map

August 28, 2014 10:36AM
Спасибо, решение уже где-то рядом )
На боевом сервере за все отвечает php-скрипт.
Сделал так:
location / {
if ($http_cookie ~ 'newsitetest') {
rewrite ^ /newsite/$uri last;
}
rewrite / /not_found.php?query_uri=/&$args;
}

location ~* ^/(.+)$ {
if ($http_cookie ~ 'newsitetest') {
rewrite ^ /newsite/$uri last;
}
try_files $uri $uri/ /not_found.php?query_uri=/$1&$args;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.html;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QWERTY $document_root$fastcgi_script_name;
}

location /newsite/ {
proxy_pass http://192.168.2.146;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

После установки куки браузер выдает 500 ошибку, в логах nginx (который проксирует) ругань на циклический редирект
2014/08/28 18:21:51 [error] 19193#0: *454 rewrite or internal redirection cycle while processing "/newsite//newsite//newsite//newsite//newsite//newsite//newsite//newsite//newsite//newsite//not_found.php"
Subject Author Posted

proxy if cookie + map

Синицкий Павел Евгеньевич August 28, 2014 07:44AM

Re: proxy if cookie + map

Илья Шипицин August 28, 2014 08:40AM

Re: proxy if cookie + map

sejo412 August 28, 2014 10:01AM

Re: proxy if cookie + map

Валентин Бартенев August 28, 2014 08:42AM

Re: proxy if cookie + map

sejo412 August 28, 2014 10:36AM

Re: proxy if cookie + map

Валентин Бартенев August 28, 2014 12:28PM

Re: proxy if cookie + map

sejo412 August 29, 2014 08:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 303
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready