0

Possible Duplicate:
running nginx as a reverse proxy with apache

how to install nginx as reverse proxy with apache ? in kloxo panel need full tutorial

onel0ve
  • 3
  • 2
  • Please try to search? This is a duplicate of the first 10 related links to the right. I also _know_ you were shown a big red warning of possible duplicates when you asked this. – hobodave Feb 25 '11 at 05:22

1 Answers1

1

You need use ssh to install nginx.

  1. Enable EPEL:

    rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/$(uname -m)/epel-release-5-3.noarch.rpm

  2. Install nginx:

    yum install nginx

  3. Change Listen in Apache2:

    Listen 127.0.0.1:80

  4. Configure nginx:

example:

 server {
    listen IP:80;
    server_name example.com www.example.com;

    location / {
        proxy_pass http://127.0.0.1:80/;
    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|gif|png|css|js)$ {
    root /var/www/example.com/;
    }
 }
ooshro
  • 10,874
  • 1
  • 31
  • 31