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

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

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

    void

    用nginx+tomcat來代替apache+jk+tomcat


    vi /usr/local/nginx/conf/nginx.conf 

    給出一些主要更改的地方 
    user  nobody nobody; 
    worker_processes  2; 
    error_log  logs/error.log  notice; 
    pid        logs/nginx.pid; 
    events { 
        worker_connections  1024; 

    http { 
        include       mime.types; 
        default_type  application/octet-stream; 
        include    /usr/local/nginx/conf/proxy.conf; 
    #上面這行是增加的 
        server { 
            listen       81; 
            server_name  localhost;   
            charset gb2312; 
    # serve static files 
            location ~ ^/(images|pages|javascript|js|css|flash|media|static)/  { 
                    root    /usr/local/www; 
                    expires 30d; 
            location / { 
                root /usr/local/www;            
                index  index.jsp index.htm; 
                proxy_pass http://192.168.1.250:8080; 
              } 

    location /NginxStatus { 
                            stub_status             on; 
                            access_log              on; 
                            auth_basic              "NginxStatus"; 
                    } 


    說明配置文件中有提到proxy.conf 這個文件可以VI一個如下文件 
    [root@test conf]# cat proxy.conf  
    #!nginx (-) 
    # proxy.conf 
    proxy_redirect          off; 
    proxy_set_header        Host            $host; 
    proxy_set_header        X-Real-IP       $remote_addr; 
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for; 
    client_max_body_size    10m; 
    client_body_buffer_size 128k; 
    proxy_connect_timeout   90; 
    proxy_send_timeout      90; 
    proxy_read_timeout      90; 
    proxy_buffers           32 4k; 
    測試配置文件 
    [root@test conf]# /usr/local/nginx/sbin/nginx -t 
    2008/05/04 15:40:02 [info] 2363#0: the configuration file /usr/local/nginx/conf/nginx.conf syntax is  

    ok 
    2008/05/04 15:40:02 [info] 2363#0: the configuration file /usr/local/nginx/conf/nginx.conf was tested  

    successfully 
    啟動 
    [root@test conf]# /usr/local/nginx/sbin/nginx 
    [root@test conf]# ps fax 
    9400 ?        Ss     0:00 nginx: master process /usr/local/nginx/sbin/nginx 
     9401 ?        S      0:00  \_ nginx: worker process       
     9402 ?        S      0:00  \_ nginx: worker process   

    http://192.168.1.250:81/NginxStatus 
    Active connections: 1  
    server accepts handled requests 
    2 2 11  
    Reading: 0 Writing: 1 Waiting: 0    


    http://192.168.1.250:81就可以訪問我的頁面了用著個nignx+tomcat來替代apache+jk+tomcat 
    同樣的可以讓squid來監聽80端口 這樣就透明代理了 
    查看服務器信息 
    [root@test conf]# curl -I http://localhost 
    HTTP/1.0 200 OK 
    Server: nginx/0.6.26 
    Date: Sun, 04 May 2008 07:18:27 GMT 
    Content-Type: text/html;charset=GBK 
    Set-Cookie: JSESSIONID=0CE2D90115EFDE9830215A55414BF11F; Path=/ 
    X-Cache: MISS from test.suantop.com 
    Via: 1.0 test.abc.com (squid/3.0.STABLE2) 
    Connection: close

    posted on 2008-08-06 14:59 void 閱讀(721) 評論(0)  編輯  收藏 所屬分類: Nginx

    主站蜘蛛池模板: 久久亚洲中文字幕精品一区| 亚洲国产成人久久一区WWW| 亚洲91av视频| 永久在线观看免费视频| 亚洲精品成人无限看| 最近中文字幕大全免费版在线| 中文亚洲AV片不卡在线观看| 中国一级特黄的片子免费| 国内精品99亚洲免费高清| 花蝴蝶免费视频在线观看高清版| 亚洲精品免费在线观看| 5555在线播放免费播放| 激情五月亚洲色图| 永久免费AV无码网站在线观看| 无人视频免费观看免费视频| 国产亚洲色婷婷久久99精品91| 久久国产乱子伦精品免费强 | 韩国18福利视频免费观看| 色偷偷噜噜噜亚洲男人| 亚洲国产中文字幕在线观看| 中文精品人人永久免费 | 免费涩涩在线视频网| 免费一级毛片在线播放视频免费观看永久 | 国产麻豆一精品一AV一免费| 亚洲精品美女在线观看播放| 24小时免费直播在线观看| 国产91成人精品亚洲精品| 亚洲人成人一区二区三区| 最近中文字幕2019高清免费| 亚洲aⅴ无码专区在线观看| 自拍偷自拍亚洲精品情侣| 未满十八18禁止免费无码网站| 亚洲xxxx18| 亚洲一区二区三区国产精品| 91福利视频免费| 亚洲JIZZJIZZ妇女| 亚洲男人的天堂在线播放| 国产精品国产免费无码专区不卡| 日韩精品无码免费专区午夜| 亚洲不卡影院午夜在线观看| 亚洲精品无码精品mV在线观看|