ssl accelerator

Igor Sysoev is at rambler-co.ru
Fri May 1 09:46:12 MSD 2009


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/





More information about the nginx mailing list