Welcome! Log In Create A New Profile

Advanced

Re: Memcache redirect

Eugene Mychlo
September 18, 2009 11:24AM
Nikita Larin wrote:
> Добрый день
>
> Nginx сначала пытается найти запрос в memecached, если не находит, то
> переправляет его в апач. Если в апаче сделать редирект (Location:
> http://ya.ru/) то апач отдаст код ответа 302. А нгинкс при этом отдает
> ошибку 404. Вот кусок конфига:
>
> nginx 0.7.62
> location / {
> default_type text/html;
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> if ($request_method = POST) {
> proxy_pass http://127.0.0.1:81;
> break;
> }
> set $memcached_key $uri$args;
> memcached_pass localhost:11211;
>

- error_page 404 502 504 @fallback;

+ error_page 404 502 504 = @fallback;

> }
>
> location @fallback {
> internal;
> root /opt/www/tv100/htdocs/;
> index index.php index.html index.htm;
> proxy_pass http://127.0.0.1:81;
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> }
>
> Спасибо.
>
>


--
Regards,
Eugene Mychlo MYC-RIPE, EAMYC-RIPN
Subject Author Posted

Memcache redirect

Nikita Larin September 18, 2009 05:14AM

Re: Memcache redirect

Eugene Mychlo September 18, 2009 05:58AM

Re: Memcache redirect

Nikita Larin September 18, 2009 06:16AM

Re: Memcache redirect

Eugene Mychlo September 18, 2009 11:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 121
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready