您的位置:首页 > 其它

不同的域名可以指向同一个项目

2018-10-10 18:00 411 查看
server{
listen 80;
server_name www.hello.com;
index index.html index.htm index.php admin.php;
root  /home/wwwroot/default/dexin/dragon/public;

#error_page   404   /404.html;
#include enable-php.conf;
include enable-php-pathinfo.conf;
location /nginx_status
{
stub_status on;
access_log   off;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires      30d;
}

location ~ .*\.(js|css)?$
{
expires      12h;
}

location ~ /\.
{
deny all;
}

location / {
if (!-e $request_filename) {
rewrite  ^(.*)$  /index.php?s=/$1  last;
}
}

access_log  /home/wwwlogs/access.log;
}
server{
listen 80;
server_name www.world.com;
index index.html index.htm index.php admin.php;
root  /home/wwwroot/default/dexin/dragon/public;

#error_page   404   /404.html;
#include enable-php.conf;
include enable-php-pathinfo.conf;
location /nginx_status
{
stub_status on;
access_log   off;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires      30d;
}

location ~ .*\.(js|css)?$
{
expires      12h;
}

location ~ /\.
{
deny all;
}

location / {
if (!-e $request_filename) {
rewrite  ^(.*)$  /index.php?s=/$1  last;
}
}

access_log  /home/wwwlogs/access.log;
}

实践证明,这两个域名都可以访问同一个资源。

www.hello.com

www.world.com

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐