<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    少年阿賓

    那些青春的歲月

      BlogJava :: 首頁(yè) :: 聯(lián)系 :: 聚合  :: 管理
      500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks
    nginx的根目錄是:D:\Sys\server\nginx\nginx-1.9.4\

    nginx配置文件目錄:D:\Sys\server\nginx\nginx-1.9.4\conf
    nginx.conf 配置文件如下:

    #user  nobody;
    worker_processes  1;
    #error_log  logs/error.log;
    #error_log  logs/error.log  notice;
    #error_log  logs/error.log  info;
    #pid        logs/nginx.pid;
    events {
        worker_connections  1024;
    }
    http {
        include       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"';
        #access_log  logs/access.log  main;
        sendfile        on;
        #tcp_nopush     on;
        #keepalive_timeout  0;
        keepalive_timeout  65;
        #gzip  on;
        include vhosts/*.conf;
    }

    這個(gè)主目錄只保留基本配置
     include vhosts/*.conf;這句話就是引用虛擬主機(jī)目錄的配置文件

    在該目錄下面創(chuàng)建vhosts目錄:
    D:\Sys\server\nginx\nginx-1.9.4\conf\vhosts
    虛擬主機(jī)(實(shí)際里面就是配置upstream和server,然后server里面配置監(jiān)聽(tīng)端口和serverName,還有l(wèi)ocation)目錄里面的配置文件分別為:
    www.abin.com.conf
    www.lee.com.conf

    www.abin.com.conf的配置為:
    upstream abin {
    server localhost:9200 weight=10;
    }
    # another virtual host using mix of IP-, name-, and port-based configuration
    server {
    listen       8000;
    server_name  www.abin.com abin.com;
    location / {
       #反向代理的地址
                proxy_pass http://abin;
       root   html;
       index  index.html index.htm;
    }
    location /abin {
       #反向代理的地址
                proxy_pass http://abin;
       root   html;
       index  index.html index.htm;
    }
    }
    www.lee.com.conf的配置為:
    upstream lee {
    server localhost:9300 weight=10;//這個(gè)配置為tomcat的請(qǐng)求地址
    }
    # another virtual host using mix of IP-, name-, and port-based configuration
    server {
    listen       8000;
    server_name  www.lee.com lee.com;
    location / {
       #反向代理的地址
                proxy_pass http://lee;
       root   html;
       index  index.html index.htm;
    }
    location /abin {
       #反向代理的地址
                proxy_pass http://lee;
       root   html;
       index  index.html index.htm;
    }
    }



    測(cè)試:
    http://www.lee.com:8000/
    http://www.lee.com:8000/abin
    http://lee.com:8000/abin
    http://www.lee.com:8000/
    http://www.lee.com:8000/lee
    http://lee.com:8000/lee

    我的tomcat服務(wù)器的web.xml都配置了<webcome-list>index.html</welcome-list>,
    tomcat:9200配置了abin這個(gè)java工程,它里面的index.html內(nèi)容為hello,abin
    tomcat:9300配置了abin這個(gè)java工程,它里面的index.html內(nèi)容為hello,lee

    那么上面的第二個(gè)地址打印hello,abin
    那么上面的第四個(gè)地址打印hello,lee


    本地hosts文件配置為:
    127.0.0.1       localhost 
    127.0.0.1       www.abin.com     abin.com 
    127.0.0.1       www.lee.com       lee.com 
    posted on 2015-08-29 15:15 abin 閱讀(536) 評(píng)論(0)  編輯  收藏 所屬分類: nginx

    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 精品国产免费一区二区三区香蕉| 亚洲日韩中文字幕日韩在线| 亚洲AV无码国产精品色午友在线| jyzzjyzz国产免费观看| 19禁啪啪无遮挡免费网站| 日本不卡视频免费| 亚洲综合图片小说区热久久| 久久国产精品免费观看| 亚洲精品午夜视频| 天天操夜夜操免费视频| 亚洲国语精品自产拍在线观看| 亚洲精品久久无码av片俺去也 | 国产免费黄色无码视频| 无码专区永久免费AV网站| 亚洲综合国产成人丁香五月激情 | 人人狠狠综合久久亚洲婷婷| 国产啪精品视频网站免费尤物| 久久久久亚洲精品影视| 久香草视频在线观看免费| 免费无码又爽又刺激高潮的视频 | 亚洲综合免费视频| 在线观看人成视频免费| 未满十八私人高清免费影院| 黑人粗长大战亚洲女2021国产精品成人免费视频| 久久精品国产亚洲AV忘忧草18 | 波多野结衣免费一区视频| 久久精品亚洲中文字幕无码麻豆| 免费大片av手机看片| 四虎成人精品一区二区免费网站| 爱情岛论坛亚洲品质自拍视频网站| 国产精品无码免费播放| 国产亚洲人成在线影院| 国产免费爽爽视频免费可以看| 特级一级毛片免费看| 亚洲va在线va天堂va888www| 免费做爰猛烈吃奶摸视频在线观看 | 男女免费观看在线爽爽爽视频| 久久精品亚洲综合专区| 成年女人午夜毛片免费看| 亚洲熟女综合色一区二区三区| 亚洲精品视频在线观看你懂的|