欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

nginx+tomcat單個域名及多個域名配置教程-創(chuàng)新互聯(lián)

項目開發(fā)接近尾聲,開始著手在生產(chǎn)環(huán)境部署項目,開發(fā)階段部署項目都沒用nginx。項目是采用SOA架構(gòu),多系統(tǒng)開發(fā),主要包括服務(wù)系統(tǒng)、中臺系統(tǒng)、后臺系統(tǒng)、金融系統(tǒng)、接口系統(tǒng)、調(diào)度系統(tǒng)、報表系統(tǒng)等。這類分布式的系統(tǒng),一般也都會用到nginx來做負(fù)載均衡。

創(chuàng)新互聯(lián)建站主要從事成都網(wǎng)站制作、網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)白山,10多年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):028-86922220

從公司剛成立就進(jìn)來,趕鴨子上架來做架構(gòu)師,負(fù)責(zé)公司的所有研發(fā)事情,搭建公司的整個技術(shù)架構(gòu),起初的所有核心業(yè)務(wù)代碼基本都由自己親自把關(guān)來進(jìn)行編碼。系統(tǒng)也從最初的只有一個pc端,發(fā)展到如今pc中臺、后臺、android端3個app、iOS端3個app,產(chǎn)品越做越多,親自負(fù)責(zé)招聘面試、培訓(xùn)。之前很多時候都有過無助和苦惱,因為負(fù)責(zé)公司整個架構(gòu),又要負(fù)責(zé)核心業(yè)務(wù)的編碼,技術(shù)難點(diǎn)的攻克,新員工的招聘及培訓(xùn),現(xiàn)在團(tuán)隊已經(jīng)都發(fā)展到16個人,而且這全是研發(fā)人員。

回想這一路,覺得之前看似爬不過去的山也不過如此,也許這就是成長吧,成長總是會伴隨些許汗水與淚水吧。由于是負(fù)責(zé)團(tuán)隊的所有事情,所以數(shù)據(jù)庫的維護(hù)、遷移數(shù)據(jù)、建索引等性能優(yōu)化,項目部署等所有事情必須得一肩挑,不要問我為什么公司沒有DBA?為什么沒有運(yùn)維?我真的只能給你一個眼神,讓你慢慢去體會。

話不多說,直接開始技術(shù)干貨分享。

nginx做負(fù)載均衡的優(yōu)勢網(wǎng)上有很多介紹資料,這里我不再多做介紹。因為有很多系統(tǒng)要部署,涉及到域名、二級域名、多個域名等的部署。在實(shí)際的部署由于對nginx的不夠熟悉,遇到過很多坑,其中這種多域名的配置,xxxx.com轉(zhuǎn)發(fā)到www.xxxx.com、訪問域名轉(zhuǎn)發(fā)到tomcat里的項目等,現(xiàn)在先總結(jié)一部坑的解決辦法。

如將xxxx.com這個域名指向8082端口里的tomcat項目,在做這個介紹前先講個插曲,如訪問xxxx.com需轉(zhuǎn)向到www.xxxx.com,這一點(diǎn)很多人都會忽略。

現(xiàn)在如果要部署中臺、后臺、金融系統(tǒng),找到nginx/conf/nginx.conf,修改配置:

upstream web{
  server localhost:8082;
}
upstream admin{
  server localhost:8083;
}
upstream finance{
  server localhost:8084;
}
server {
  listen    80;
  server_name finance.xxxx.com;
  #charset koi8-r;
  #access_log logs/host.access.log main;
  location / {
    proxy_pass http://finance;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
  #error_page 404       /404.html;
  # redirect server error pages to the static page /50x.html
  #
  error_page  500 502 503 504 /50x.html;
  location = /50x.html {
    root  html;
  }
}
server {
  listen    80;
  server_name www.xxx.com;
  #charset koi8-r;
  #access_log logs/host.access.log main;
  location / {
    proxy_pass http://web;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;      
  }
  #error_page 404       /404.html;
  # redirect server error pages to the static page /50x.html
  #
  error_page  500 502 503 504 /50x.html;
  location = /50x.html {
    root  html;
  }
  # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  #
  #location ~ \.php$ {
  #  proxy_pass  http://127.0.0.1;
  #}
  # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  #
  #location ~ \.php$ {
  #  root      html;
  #  fastcgi_pass  127.0.0.1:9000;
  #  fastcgi_index index.php;
  #  fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  #  include    fastcgi_params;
  #}
  # deny access to .htaccess files, if Apache's document root
  # concurs with nginx's one
  #
  #location ~ /\.ht {
  #  deny all;
  #}
}
server {
  server_name xxxx.com;
  rewrite ^(.*) http://www.xxxx.com$1 permanent;
}
server {
  listen    80;
  server_name admin.xxxx.com;
  #charset koi8-r;
  #access_log logs/host.access.log main;
  location / {
    proxy_pass http://admin;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;      
  }
  #error_page 404       /404.html;
  # redirect server error pages to the static page /50x.html
  #
  error_page  500 502 503 504 /50x.html;
  location = /50x.html {
    root  html;
  }
  # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  #
  #location ~ \.php$ {
  #  proxy_pass  http://127.0.0.1;
  #}
  # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  #
  #location ~ \.php$ {
  #  root      html;
  #  fastcgi_pass  127.0.0.1:9000;
  #  fastcgi_index index.php;
  #  fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  #  include    fastcgi_params;
  #}
  # deny access to .htaccess files, if Apache's document root
  # concurs with nginx's one
  #
  #location ~ /\.ht {
  #  deny all;
  #}
}

文章名稱:nginx+tomcat單個域名及多個域名配置教程-創(chuàng)新互聯(lián)
鏈接分享:http://aaarwkj.com/article20/cocdjo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制開發(fā)、全網(wǎng)營銷推廣、標(biāo)簽優(yōu)化搜索引擎優(yōu)化、移動網(wǎng)站建設(shè)、ChatGPT

廣告

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

成都seo排名網(wǎng)站優(yōu)化
欧美日韩国产免费电影| 色呦呦视频在线免费看 | 欧美伦理片三级在线观看 | 一区三区三区日韩高清不卡| 看看美女阴逼毛茸茸的| 给我搜一个一级黄色片| 国产一区二区乱码在线| 免费欧美一级黄片播放| 91麻豆精品国产综合久久久| 国产人妖cd蜜雅丝袜美女| 国内自拍韩国资源在线| 欧美日韩国产成人激情| 高清一区二区三区不卡视频| 亚洲精品一区二区三区不卡| 哪里可以看黄色片日韩| 久久91亚洲精品中文字幕| 亚州欧美精品一区二区| 日韩精品一区二区三区夜色| 青青草青青草在线观看视频| 高清av在线国产成人精品自拍| 久久精品熟女亚洲av韩国| 国产精品国产自产拍高清| 亚洲一区二区三区免费在线看| 人妻少妇被猛烈进入中出视频| 四影虎影永久免费观看| 少妇被啪出水在线视频| 国产第一页国产第一页| 欧美一区二区三区高清在线| 日本一区二区三区日韩欧美| 在线免费观看国产黄色av| 欧美日韩亚洲中文国产| 成人黄色小视频下载| 国产精品国产三级国产av野外| 日韩人妻一级免费视频| 欧美日韩亚洲一区在线| 亚洲免费精品一区二区三区四区| 日本黄色中文字幕在线观看 | 国产女人和拘做受视频| 亚洲国产偷拍在线观看| 一级黄片一区二区三区| 变态另类欧美国产在线|