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

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

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

    少年阿賓

    那些青春的歲月

      BlogJava :: 首頁 :: 聯(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)聽端口和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 閱讀(525) 評(píng)論(0)  編輯  收藏 所屬分類: nginx

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


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 99re6在线精品免费观看| 亚洲日韩乱码中文无码蜜桃臀网站| 免费观看男人吊女人视频| 美女18毛片免费视频| 亚洲va在线va天堂成人| 亚洲国产精品嫩草影院在线观看 | 免费人成视频x8x8入口| 免费看污成人午夜网站| 一级毛片成人免费看免费不卡| 四虎影视在线看免费观看| 亚洲精品欧美综合四区| 亚洲国产理论片在线播放| 久久久久亚洲精品影视| 精品国产日韩亚洲一区| 免费少妇a级毛片| 成人影片麻豆国产影片免费观看 | 亚洲偷自拍拍综合网| 免费的涩涩视频在线播放| 免费福利视频导航| 日韩免费无码一区二区三区 | 精品久久久久久亚洲| 亚洲综合国产精品第一页| 免费观看午夜在线欧差毛片| 国内精品免费视频自在线| 免费在线观看的网站| 国产黄色免费网站| 中文字幕免费在线看线人| 99在线视频免费| 久久久免费精品re6| 99精品视频在线免费观看| 久久精品一区二区免费看| 18禁超污无遮挡无码免费网站| 99在线视频免费观看| 国产线视频精品免费观看视频| 国产黄片不卡免费| 你懂的在线免费观看| 精品四虎免费观看国产高清午夜| 一个人看的www免费视频在线观看| a毛片免费全部播放完整成| 一个人看的www免费视频在线观看| 免费视频一区二区|