All domains picking same content of one site?

Vicente Aguilar bisente at bisente.com
Sun Feb 28 23:03:22 MSK 2010


Hi

> Below is the config details

Doesn't look bad to me. Anyway:

> server {
> listen 80;
> server_name YOURSERVERNAME;

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 <VirtualHost> 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:

http://wiki.nginx.org/NginxHttpCoreModule#server_name

If you only have one name on server_name, I guess nginx would only serve that domain.

> location / {
> proxy_pass http://myip:8080/;
> proxy_redirect off;
> proxy_set_header Host $host;

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.

Hope that helps.

Regards

-- 
  Vicente Aguilar <bisente at bisente.com> | http://www.bisente.com




More information about the nginx mailing list