FAQ

Page Discussion Edit History

ChsFcgiExample

(Redirected from NginxChsFcgiExample)

somaceo閰嶇疆鐨勪竴涓ず渚嬶紝nginx鐗堟湰涓簑indows 缂栬瘧鐗堟湰 nginx-0.7.64锛岃В鍐充簡alias 铏氭嫙鐩綍涓嶆敮鎸佽繍琛宲hp鐨勯棶棰橈紝璇ョ増鏈彲浠ヤ娇鐢ㄤ腑鏂囨枃浠跺悕銆佷腑鏂囩洰褰曘亀indows鐨勬枃浠跺悕鏍煎紡銆侀┍鍔ㄥ櫒鐩樼绛夈傜ず渚嬫槸涓涓猟iscuz璁哄潧鍙妘chomephp绋嬪簭缃戠珯銆



#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;

    server {
        listen       80;
        server_name   dabao.imbbs.in;
        #涓嬮潰涓よ鏄矾寰勫悗闈㈣嚜鍔ㄥ姞涓/
        root   H:\APMServ526\www\Dis\uc_home;
        if (-d $request_filename) {rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;}

        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        location / {
            root   H:\APMServ526\www\Dis\uc_home;
            index  index.php index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        #=======铏氭嫙鐩綍涔熸敮鎸乸hp
            location /bbs {
             alias H:\APMServ526\www\dis;
             index index.php index.html index.htm;
             }
             location ~ ^/bbs/.+\.php$ {
             #location /bbs/.+\.php$ {
             root H:\APMServ526\www\dis;
             rewrite /bbs/(.*\.php?) /$1 break;
             include        fastcgi_params;
             fastcgi_pass   127.0.0.1:9000;
             fastcgi_index  index.php;
             fastcgi_param SCRIPT_FILENAME H:\APMServ526\www\dis$fastcgi_script_name;
             }
#==========
#-------
        location /uc {
        alias H:\APMServ526\www\dis\uc;
        index index.php index.html index.htm;
       # autoindex on;
       # autoindex_exact_size on;
        }
     
#-------

        location /dis {
        alias H:\APMServ526\www\dis;
        index index.php index.html index.htm;
    
        autoindex on;
       # autoindex_exact_size on;
        }
                    
        location /dis/attachments/dvbbs {
        alias H:\WWW\DV82UTF-8\UploadFile;
  
     # autoindex on;
       # autoindex_exact_size on;
        } 
      location /bbs/attachments/dvbbs {
        alias H:\WWW\DV82UTF-8\UploadFile;
  
        } 
        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
       # location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
       # }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
            location ~ \.php$ {
           root   H:\APMServ526\www\Dis\uc_home;
         if ( $uri ~ ^/uc/ ) {
             root H:\APMServ526\www\dis;
           } 
         # if ( $uri ~ ^/dis/ ) {
         #      root H:\APMServ526\www;
         #  } 
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
      
       fastcgi_param SCRIPT_FILENAME    $document_root$fastcgi_script_name;
            #fastcgi_param  SCRIPT_FILENAME    H:\APMServ526\www\Dis\uc_home$fastcgi_script_name;

            include        fastcgi_params;
        }
       #璁剧疆鏌ョ湅nginx鐨勮繍琛岀姸鎬佺殑鐩綍/ng/
       location ~ ^/ng/ { 
       stub_status on;
       access_log off; 

       }
}



}