nginx把顶级域名和二级域名指向不同端口的tomcat

    server {
        listen       90;
        server_name  io.ceadeal.com;
        location / {
            proxy_pass http://localhost:9001;
            proxy_set_header XHost $host:$server_port;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }
    server {
        listen       90;
        server_name  blog.ceadeal.com;
        location / {
            proxy_pass http://localhost:9002;
            proxy_set_header XHost $host:$server_port;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }

你可能感兴趣的:(nginx把顶级域名和二级域名指向不同端口的tomcat)