tomcat之nginx调度

# :安装nginx 

[root@nginx ~]# yum install nginx -y

#配置

[root@nginx ~]# vim /etc/nginx/nginx.conf

    upstream tomcats {
        server node1.magedu.com:8080;
        server node2.magedu.com:8080;
    }

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
                proxy_pass http://tomcats;
        }
#:修改tomcat配置


[root@node1 ~]# vim /usr/local/tomcat/conf/server.xml
      </Host>
      <Host name="node1.magedu.com"  appBase="/data/webapps">
      </Host>

    <Engine name="Catalina" defaultHost="node1.magedu.com">

 

posted @ 2019-09-02 16:43  Linus小跟班  阅读(170)  评论(0编辑  收藏  举报