系統(tǒng)運維 簡介
操作環(huán)境在生產(chǎn)環(huán)境中,很多企業(yè)會經(jīng)常使用nginx + tomcat 架構(gòu),nginx作為負(fù)載均衡器,反向代理,tomcat作為節(jié)點服務(wù)器。在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è)服務(wù)。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站建設(shè)公司要多少錢,請找那個售后服務(wù)好的鄖西做網(wǎng)站的公司定做!
部署過程: 一、安裝nginx鏡像備注:實驗中已關(guān)閉防火墻,打好企業(yè)使用的war包
二、部署war包項目可參考博客 https://blog.51cto.com/13760351/2469063
三、修改nginx配置文件部署及排坑過程可參考博客 https://blog.51cto.com/13760351/2469305
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://m.kartarina.com/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)