Welcome! Log In Create A New Profile

Advanced

Setting up nginx as reverse proxy to Apache, what's wrong?

Thuan Nguyen
January 28, 2010 07:28PM
Hi all,

I've been trying to setup nginx to run as front of Apache on my busy server
but things seem not fine to me.

nginx (0.6.39), Apache (2.2.3) are installed from yum, mod_rpaf (0.6) built
from source.

For testing, I've set nginx to listen port 81.

Here's my configurations:

nginx:
server {
listen 81;
server_name mydomain.com *. mydomain.com;
root /home/mywwwroot;

location / {
proxy_pass http://127.0.0.1/;
proxy_redirect default;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~*
^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$
{
root /home/mywwwroot;
access_log off;
expires 10d;
}
}

mod_rpaf:
LoadModule rpaf_module modules/mod_rpaf-2.0.so

RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1 x.x.168.29
RPAFheader X-Real-IP

When I access http://mydomain.com:81/, it always show the Apache's default
page like I am accessing http://localhost/.

Thanks.
--
Nguyen Duc Thuan
http://www.ndthuan.com/
me@ndthuan.com
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Setting up nginx as reverse proxy to Apache, what's wrong?

Thuan Nguyen January 28, 2010 07:28PM

Re: Setting up nginx as reverse proxy to Apache, what's wrong?

rok January 29, 2010 03:53AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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