Newbie questions about nginx (moving from apache)

Igor Sysoev igor at sysoev.ru
Fri May 27 12:34:14 MSD 2011


On Fri, May 27, 2011 at 04:28:10AM -0400, pk899 wrote:
> thanks igor. wow, so fast reply. 
> 
> how can i setup nginx "before apache"? will i have to change apache
> port? 
> 
> and what will the syntax look like. is there any simple guide? i have a
> high traffic site so dont want to break the functionality. 

You should test nginx setup on 81 port passing request to Apache on 80:

server {
    listen  81;
    server_name  your.domain.com;

    root  /path/to/static;

    location / {
        proxy_pass        http://127.0.0.1;
        proxy_set_header  Host  $host;
        proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
    }

    location /mysite/images/ {
    }

}

You may need to add mod_rpaf to Apache to process client IPs passed
by nginx in X-Forwarded-For.


-- 
Igor Sysoev



More information about the nginx mailing list