Nginx+Tomcat实现单IP、多域名、多站点的访问

预算有限,单IP实现多域名多站点访问,
nginx.conf引入:include nginx.define.conf;
最新配置(nginx.define.conf)如下:
cat nginx.define.conf
server {
    listen       80;
    server_name  *.smhsfp.com smhsfp.com;
    location / {
        proxy_pass http://127.0.0.1:8080/smhsfp/;
        proxy_set_header   Host    $host;
        proxy_set_header   X-Real-IP   $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        index  index.html;
    }
}
server {
    listen       80 default;
    server_name  _;
    location / {
        proxy_pass http://127.0.0.1:8082/wenwen/;
        proxy_set_header   Host    $host;
        proxy_set_header   X-Real-IP   $remote_addr;
        proxy_set_header   X-Forwarded-For $remote_addr;
        index  index.html;
    }
}
server {
        listen       80;
        server_name  static.jiucheng.org;
        root   "/usr/www/static";
        location / {
            index  index.html;
            #autoindex  on;
        }
} 
53

评论

  1. dqeqwe

  2. 213123

    1. @匿名 eqeqw

      1. @匿名 ewqeqw

    1. @匿名 ewqeqwe

    1. @匿名 有意思吗!

      1. @旧城 你这个逻辑貌似有点问题

  3. 新回复是在被回复的下面,支持三层!

    1. @旧城 http://comment.ent.163.com/ent2_bbs/BCLPG2ME00031GVS.html 你看这里面的 所谓的盖楼

      1. @匿名 这是另一种引入回复。

  4. 哈哈哈 ,路过,久仰大神

发表评论

电子邮件地址不会被公开。 必填项已用*标注

点击更换