全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 4224|回复: 14

[nginx] 请教一个问题,nginx怎么把2个域名绑定都一个目录?

[复制链接]
发表于 2010-12-12 23:48:48 | 显示全部楼层 |阅读模式
比如abc.com和123.com,其中包括主页和bbs.abc.com和bbs.123.com

要同时访问,不用跳转。。

配置文件怎么写好?
  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name abc.com;
  5.                 index index.html index.htm index.php;
  6.                 root  /home/wwwroot;

  7.                 location ~ .*\.(php|php5)?$
  8.                         {
  9.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  10.                                 fastcgi_index index.php;
  11.                                 include fcgi.conf;
  12.                         }

  13.                 location /status {
  14.                         stub_status on;
  15.                         access_log   off;
  16.                 }
复制代码
发表于 2010-12-12 23:49:27 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2010-12-12 23:49:41 | 显示全部楼层
server_name abc.com bbs.abc.com bbs.123.com;
发表于 2010-12-12 23:49:51 | 显示全部楼层
server_name abc.com www.abc.com www.aaa.com aaa.com www.china.com china.com;
 楼主| 发表于 2010-12-12 23:50:10 | 显示全部楼层
补充。。一个ip
 楼主| 发表于 2010-12-12 23:50:22 | 显示全部楼层
补充。。一个ip
 楼主| 发表于 2010-12-12 23:50:50 | 显示全部楼层
多谢大家,我先去试试~


昏。。多连了
发表于 2010-12-12 23:50:55 | 显示全部楼层
楼上3位 - -# 解释的已经很清楚了、、


眨眼间~ 冒出来N多的帖子、、
发表于 2010-12-12 23:52:23 | 显示全部楼层
谢谢大家, 我学懂了。
发表于 2010-12-12 23:53:02 | 显示全部楼层
  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name www.abc.com abc.com www.abcd.com abcd.com;
  5.                 index index.html index.htm index.php;
  6.                 root  /home/wwwroot;

  7.                 location ~ .*\.(php|php5)?$
  8.                         {
  9.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  10.                                 fastcgi_index index.php;
  11.                                 include fcgi.conf;
  12.                         }

  13.                 location /status {
  14.                         stub_status on;
  15.                         access_log   off;
  16.                 }
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-6 15:44 , Processed in 0.075405 second(s), 7 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表