nginx中多ip多域名多端口配置

1、Nginx中多IP配置:

server {
    listen 80;
    server_name 192.168.15.7;
    location / {
    root /opt/Super_Marie;
        index index.html;
    }
}
server {
    listen 80;
    server_name 172.16.1.7;
    location / {
        root /opt/tank;
        index index.html;
    }
}

2、Nginx中多域名配置:

server {
    listen 80;
    server_name www.game.com;
    location / {
        root /opt/Super_Marie;
        index index.html;
    }
}
server {
    listen 80;
    server_name www.game1.com;
    location / {
        root /opt/tank;
        index index.html;
    }
}

3、Nginx中多端口配置:

server {
    listen 80;
    server_name 192.168.15.7;
    location / {
        root /opt/Super_Marie;
        index index.html;
    }
}
server {
    listen 81;
    server_name 192.168.15.7;
    location / {
        root /opt/tank;
        index index.html;
    }
}

 

posted on 2023-03-03 23:03  一先生94  阅读(1437)  评论(0编辑  收藏  举报

导航