Hii,
I am running several sites at dedicated server. Earlier i was using
apache only, but now i’ve change it to nginx and now i’m using nginx
with apache.
But after installing inginx, my one site is working properly, but rest
all five sites picking the same data of one site.
I’ve configured apache to port 8080 and Nginx to port 80.
How have you configured virtual servers in nginx? You have to configure
each domain to go to its content, if you haven’t it wouldn’t work. Could
you post the part of your config dealing with this?
You say you’re using both apache and nginx. But do they work together or
you just want to have them side by side in order to compare them? In
other workds, does nginx act as a proxy to apache or it works on its
own?
You need real server names here, I guess you know that and you’re just
hiding your server name, just like below with “myip”.
The whole server block is like a block in Apache, and
server_name is the list of ServerName and ServerAlias for that vhost.
You can either replicate the server section for each vhost with
different server names and different options, or use a generic config
with server_name wildcards like “server_name _;” as per:
This looks ok, you’re correctly setting the Host header so that nginx
passes it to Apache.
I assume you’ve tested Apache and it’s working OK for every domain. One
thing you can test is sniffing some traffic between nginx and Apache
with tcpdump and make sure nginx is setting the correct Host header and
Apache is returning the proper content. Anyway that part of the config
looks ok.