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

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

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

    void

    用nginx+tomcat來(lái)代替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"; 
                    } 


    說(shuō)明配置文件中有提到proxy.conf 這個(gè)文件可以VI一個(gè)如下文件 
    [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; 
    測(cè)試配置文件 
    [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 
    啟動(dòng) 
    [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就可以訪問(wèn)我的頁(yè)面了用著個(gè)nignx+tomcat來(lái)替代apache+jk+tomcat 
    同樣的可以讓squid來(lái)監(jiān)聽80端口 這樣就透明代理了 
    查看服務(wù)器信息 
    [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) 評(píng)論(0)  編輯  收藏 所屬分類: Nginx

    主站蜘蛛池模板: 免费无码看av的网站| 1000部拍拍拍18勿入免费视频软件| 日韩一区二区a片免费观看| 亚洲视频中文字幕在线| 日韩精品人妻系列无码专区免费| 亚洲AV日韩AV永久无码下载| 免费无码又爽又刺激高潮视频| 久久青青草原亚洲AV无码麻豆 | 粉色视频成年免费人15次| 日本不卡在线观看免费v| 边摸边脱吃奶边高潮视频免费| 亚洲av无码一区二区三区天堂 | 久久久www成人免费毛片| 亚洲精品无码久久久久APP | 日韩亚洲国产二区| 亚美影视免费在线观看| 国产精品亚洲а∨无码播放| 日本免费中文字幕| 亚洲一区二区三区高清视频| 国产高清免费在线| 一级毛片免费在线播放| 亚洲va无码手机在线电影| 免费看韩国黄a片在线观看| 免费无遮挡无码视频在线观看| 中文字幕亚洲综合久久菠萝蜜| 人妻丰满熟妇无码区免费| 日本亚洲免费无线码| 亚洲国产成人精品91久久久| 小日子的在线观看免费| 亚洲中文字幕无码亚洲成A人片| 免费人成网站在线高清| 久久成人免费播放网站| 亚洲一区AV无码少妇电影| 国产亚洲一区区二区在线| 777爽死你无码免费看一二区| 亚洲性色AV日韩在线观看| 精品久久久久久亚洲| 麻豆一区二区免费播放网站 | 久久免费高清视频| 亚洲影院天堂中文av色| 国产亚洲精午夜久久久久久|