最近2018中文字幕在日韩欧美国产成人片_国产日韩精品一区二区在线_在线观看成年美女黄网色视频_国产精品一区三区五区_国产精彩刺激乱对白_看黄色黄大色黄片免费_人人超碰自拍cao_国产高清av在线_亚洲精品电影av_日韩美女尤物视频网站

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Docker怎樣部署nginx+tomcat-創(chuàng)新互聯(lián)

這期內(nèi)容當中小編將會給大家?guī)碛嘘P(guān)Docker怎樣部署nginx + tomcat,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。

10年積累的網(wǎng)站建設(shè)、成都做網(wǎng)站經(jīng)驗,可以快速應(yīng)對客戶對網(wǎng)站的新想法和需求。提供各種問題對應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認識你,你也不認識我。但先建設(shè)網(wǎng)站后付款的網(wǎng)站建設(shè)流程,更有涼城免費網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。

簡介

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

操作環(huán)境

Docker怎樣部署nginx + tomcat

備注:實驗中已關(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

上述就是小編為大家分享的Docker怎樣部署nginx + tomcat了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道。


本文名稱:Docker怎樣部署nginx+tomcat-創(chuàng)新互聯(lián)
轉(zhuǎn)載源于:http://fisionsoft.com.cn/article/echho.html