您的位置:首页 > 运维架构 > Nginx

nginx多域名设置和多子目录实现共用一端口

2012-08-08 09:46 507 查看

nginx多域名设置,多子目录,共用一端口

nginx多域名设置,多子目录,公用一端口

前段时间自己买了一个80G的服务器,所以想把原来的网站都整合到这台服务器上面,现在在服务器上绑定了五个域名。

下面是对nginx配置文件的设置。

五个域名公用一个端口,80端口,在内部设置子目录。

server {

listen 80;

server_name www.china7s.com;

root /home/ftp/china7s;

location / {

index index.html index.htm index.shtml index.php default.php;

}

#access_log /dev/null lu_access_log_2;

error_page 404 /404.html;

location ~ \.php$ {

fastcgi_pass 127.0.0.1:9000;

include enable_php.conf;

}

}

server {

listen 80;

server_name www.wtogame.com;

root /home/ftp/LuNamp;

location / {

index index.html index.htm index.shtml index.php default.php;

}

#access_log /dev/null lu_access_log_2;

error_page 404 /404.html;

location ~ \.php$ {

fastcgi_pass 127.0.0.1:9000;

include enable_php.conf;

}

}

server {

listen 80;

server_name www.hangzhou.la;

root /home/ftp/hangzhou;

location / {

index index.html index.htm index.shtml index.php default.php;

}

#access_log /dev/null lu_access_log_2;

error_page 404 /404.html;

location ~ \.php$ {

fastcgi_pass 127.0.0.1:9000;

include enable_php.conf;

}

}

server {

listen 80;

server_name www.nginx.name;

root /home/ftp/nginx;

location / {

index index.html index.htm index.shtml index.php default.php;

}

#access_log /dev/null lu_access_log_2;

error_page 404 /404.html;

location ~ \.php$ {

fastcgi_pass 127.0.0.1:9000;

include enable_php.conf;

}

}

server {

listen 80;

server_name www.axiaoshuo.com axiaoshuo.com;

root /home/ftp/axiaoshuo;

location / {

index index.html index.htm index.shtml index.php default.php;

}

#access_log /dev/null lu_access_log_2;

error_page 404 /404.html;

location ~ \.php$ {

fastcgi_pass 127.0.0.1:9000;

include enable_php.conf;

}

}

server {

listen 80;

server_name www.19594.com;

root /home/ftp/19594;

location / {

index index.html index.htm index.shtml index.php default.php;

}

#access_log /dev/null lu_access_log_2;

error_page 404 /404.html;

location ~ \.php$ {

fastcgi_pass 127.0.0.1:9000;

include enable_php.conf;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  配置 端口 目录