Welcome! Log In Create A New Profile

Advanced

Re: All domains picking same content of one site?

Vicente Aguilar
February 28, 2010 03:12PM
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@bisente.com> | http://www.bisente.com


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

All domains picking same content of one site?

sam77am February 28, 2010 12:01AM

Re: All domains picking same content of one site?

Vicente Aguilar February 28, 2010 02:24AM

Re: All domains picking same content of one site?

sam77am February 28, 2010 06:59AM

Re: All domains picking same content of one site?

sam77am February 28, 2010 07:05AM

Re: All domains picking same content of one site?

edogawaconan February 28, 2010 11:28AM

Re: All domains picking same content of one site?

Vicente Aguilar February 28, 2010 03:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 183
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready