May 01, 2009 01:46AM
On Fri, May 01, 2009 at 12:49:21AM +0200, Joe Bofh wrote:

> Igor,
>
> Can you explain why it's better to use this format?

Due to unbethought implementation "if" may work not so as you expect.
Probably, the only natural usage is:

if (...) {
return 403;
}

and

if (...) {
rewrite ... last;
}

The following examples

if (...) {
rewrite ... break;
}

if (...) {
break;
}

have may drawbacks.

As to "upstream", you do not need it for single upstream server and
using real host in proxy_pass allow to use default proxy_redirect.

With upstream you should add

proxy_redirect http://dev1.magazine.com:8000/ /;

because default proxy_redirect will be without port

proxy_redirect http://dev1.magazine.com/ /;


> --J
>
> Igor Sysoev wrote:
>
> >
> > Also, it's better to use this configuration
> >
> > location / {
> > root html;
> > index index.html index.htm;
> > try_files $uri @magazine;
> > }
> >
> > locaiton @magazine {
> > proxy_set_header X-Real-IP $remote_addr;
> > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> > proxy_set_header Host $http_host;
> > proxy_set_header X-FORWARDED_PROTO https;
> >
> > proxy_pass http://dev1.magazine.com:8000;
> > }
> >
> > without "if" and "upstream dev1.magazine.com".
> >
> > By default
> >
> > proxy_pass http://dev1.magazine.com:8000;
> >
> > also adds
> >
> > proxy_redirect http://dev1.magazine.com:8000/ /;
>
> --
> Posted via http://www.ruby-forum.com/.

--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

ssl accelerator

lovewadhwa April 29, 2009 10:08AM

Re: ssl accelerator

lovewadhwa April 30, 2009 07:26AM

Re: ssl accelerator

Igor Sysoev April 30, 2009 08:08AM

Re: ssl accelerator

Joe Bofh April 30, 2009 06:49PM

Re: ssl accelerator

Igor Sysoev May 01, 2009 01:46AM

Re: ssl accelerator

Joe Bofh May 01, 2009 02:38AM

Re: ssl accelerator

Igor Sysoev May 01, 2009 02:43AM

Re: ssl accelerator

Joe Bofh May 01, 2009 04:15AM

Re: ssl accelerator

Igor Sysoev May 01, 2009 04:36AM

Re: ssl accelerator

Joe Bofh May 01, 2009 04:13AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 253
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