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;
}