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

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

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

    少年阿賓

    那些青春的歲月

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      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;
    }

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

    在該目錄下面創建vhosts目錄:
    D:\Sys\server\nginx\nginx-1.9.4\conf\vhosts
    虛擬主機(實際里面就是配置upstream和server,然后server里面配置監聽端口和serverName,還有location)目錄里面的配置文件分別為:
    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;//這個配置為tomcat的請求地址
    }
    # 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;
    }
    }



    測試:
    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服務器的web.xml都配置了<webcome-list>index.html</welcome-list>,
    tomcat:9200配置了abin這個java工程,它里面的index.html內容為hello,abin
    tomcat:9300配置了abin這個java工程,它里面的index.html內容為hello,lee

    那么上面的第二個地址打印hello,abin
    那么上面的第四個地址打印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 閱讀(526) 評論(0)  編輯  收藏 所屬分類: nginx

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 日韩中文字幕免费| 国产免费69成人精品视频| 亚洲午夜久久久影院伊人| 一级特级女人18毛片免费视频| 免费一级毛片不卡在线播放| 亚洲AV成人精品一区二区三区| 国产无遮挡吃胸膜奶免费看视频 | 免费无码黄网站在线观看| 亚洲欧洲日韩国产一区二区三区| 91香蕉成人免费网站| 亚洲免费福利视频| 精品国产免费观看一区| 国产成人综合久久精品亚洲| heyzo亚洲精品日韩| 又长又大又粗又硬3p免费视频| 国产亚洲一区区二区在线| 日韩电影免费在线观看中文字幕| 亚洲AV无码成人精品区天堂| 精品无码免费专区毛片| 亚洲中文字幕无码爆乳app| 国产福利免费观看| 中文字幕免费在线播放| 亚洲高清免费在线观看| 女人18一级毛片免费观看| 鲁啊鲁在线视频免费播放| 亚洲日产无码中文字幕| 足恋玩丝袜脚视频免费网站| 亚洲精品无码aⅴ中文字幕蜜桃| 亚洲av区一区二区三| 日本亚洲欧洲免费天堂午夜看片女人员| 色播亚洲视频在线观看| 日美韩电影免费看| 99久久成人国产精品免费| 亚洲一区在线免费观看| 亚洲精品成人在线| 24小时日本电影免费看| 免费播放美女一级毛片| 香蕉视频在线观看亚洲| 日本a级片免费看| 久久久久久久岛国免费播放 | 激情内射亚洲一区二区三区|