configurationNginx接受所有域

我有一台服务器Ubuntu 11.10与Nginx 1.2.1 Asumme,我的域名是:domain.com Nginx作为反向代理:redmine.domain.com =>指向端口3000上的webrick redmine svn.domain.com =>指向apache2端口8080 domain.com,www.domain.com,和所有域(等:abc.com,def.com,ghi.com)=> php-fastcgi端口9000

您可能想知道为什么我必须接受所有域名(abc.com,def.com,ghi.com),是的,这是我们的服务,允许客户在我们的Multi-Tanency应用程序中使用他们的域名。

但问题是:当我使用abc.com(在我的笔记本电脑上的文件主机上添加logging),要访问我的服务器,nginx将请求redirect到我们的redmine。 我想让nginxredirect到像php-fastcgi一样的configuration

这里是我在Nginx上的configuration:(/ etc / nginx / sites-enabled /)

pipe理平台

server { listen 80; server_name redmine.sieuthimoi.vn; access_log /var/log/nginx/access.log; location / { auth_basic "Not Allow Here"; auth_basic_user_file /etc/nginx/htpasswd; proxy_pass http://127.0.0.1:3000; include /etc/nginx/proxy.conf; } 

}

和PHP-FastCgi

 server { #listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 root /usr/share/nginx/www/site; index index.php index.htm index.html; # Make site accessible from http://localhost/ server_name domain.com _; location ~ .php$ { try_files $uri /index.php index index.php; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/www/site$fastcgi_script_name; include fastcgi_params; } 

}

请注意:domain.com完美工作。

任何人都请帮助我。 非常感谢你

你应该使用listen 80 default_server; 在你的PHP-FastCGI server部分。