Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

marked as duplicate by sysadmin1138 Feb 25 '11 at 6:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
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 5:22

1 Answer 1

up vote 1 down vote accepted

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/;
    }
 }
share|improve this answer
    
tried domain not working –  onel0ve Feb 27 '11 at 4:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.