2

I have some trouble configuring nginx as reverse proxy.

It is good to say I have a VPS with kloxo and webmin installed and running multiple domains on my VPS.

I have installed nginx via REPEL and YUM and this is my /etc/nginx/nginx.conf file given in this link.

I change apache port to 8080 and restart service for making changes and start nginx and there is some problem.

When I try reaching every domains on my centos vps, I face to APACHE START PAGE (WELCOME PAGE) and when I enter my VPS IP in browser like x.x.x.x, I face to NGINX START PAGE (WELCOME PAGE).

I want nginx to serve my static files and redirect dynamic ones to Apache for better performance.

RAM
  • 2,413
  • 1
  • 21
  • 33
amin
  • 21
  • 1

1 Answers1

0

There is an example from the book Nginx Http Server, page 235.

server {
    server_name .example.com;
    root /home/example.com/www;
    location ~* \.php.$ {
        # Proxy all requests with an URI ending with .php*
        # (includes PHP, PHP3, PHP4, PHP5...)
        proxy_pass http://127.0.0.1:8080;
    }
    location / {
        # Your other options here for static content
        # for example cache control, alias...
        expires 30d;
    }
}
hailinzeng
  • 966
  • 9
  • 24