欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

Docker部署nginx+tomcat

系統(tǒng)運維 簡介

在生產(chǎn)環(huán)境中,很多企業(yè)會經(jīng)常使用nginx + tomcat 架構(gòu),nginx作為負載均衡器,反向代理,tomcat作為節(jié)點服務器。在docker容器中也可以使用這種架構(gòu)。
對這種架構(gòu)感興趣的可以參考博客:https://blog.51cto.com/13760351/2161850

鄖西網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián)公司,鄖西網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為鄖西上千家提供企業(yè)網(wǎng)站建設(shè)服務。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站建設(shè)公司要多少錢,請找那個售后服務好的鄖西做網(wǎng)站的公司定做!
操作環(huán)境

備注:實驗中已關(guān)閉防火墻,打好企業(yè)使用的war包

部署過程: 一、安裝nginx鏡像

可參考博客 https://blog.51cto.com/13760351/2469063

二、部署war包項目

部署及排坑過程可參考博客 https://blog.51cto.com/13760351/2469305

三、修改nginx配置文件

vim /etc/nginx/nginx.conf

user  nginx;
worker_processes  1;
error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    log_format  main  \'$remote_addr - $remote_user [$time_local] $request \'
                      \'$status $body_bytes_sent $http_referer \'
                      \'$http_user_agent $http_x_forwarded_for $upstream_addr\';

    access_log  /var/log/nginx/access.log  main;
    sendfile        on;
    #tcp_nopush     on;
    keepalive_timeout  65;
    #gzip  on;
    upstream tomcat {
        server 47.99.150.153:8088 weight=1;  #添加權(quán)重
        server 47.99.150.155:8088 weight=1;
    }

    server {
        listen 80;
        server_name localhost;

                location / {
            root  /usr/share/nginx/html;
            index  index.html index.htm;
            }

        location /admin {
            proxy_pass http://tomcat;  #添加
            proxy_redirect off;
            index index.html index.htm;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Real-Port $remote_port;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }

    include /etc/nginx/conf.d/*.conf;
}
四、網(wǎng)頁驗證

新聞名稱:Docker部署nginx+tomcat
文章出自:http://chinadenli.net/article48/cpcdep.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號用戶體驗虛擬主機建站公司網(wǎng)站營銷商城網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都app開發(fā)公司