nginx 의 nginx. conf 설정 파일 수정

4646 단어 CentOS

nginx nginx.conf       

  :
    1. user  www; //           www     。
    2.     /usr/local/nginx/logs      ,    
        access.log  error.log  nginx.pid  www.log


//==============      ====================//
user  www;
worker_processes  8;

error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

pid        logs/nginx.pid;

events {
    worker_connections  2048;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;
        server_name  127.0.0.1;

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
     location /{
          root          /WebRoot/cmy;
          index         index.php;
                    if (-f $request_filename) {
                                expires max;
                                break;
                    }
                        if (!-e $request_filename) {
                                        rewrite ^/(.*)$ /index.php/$1 last;
                        }

        }

                 location ~ ^(.+\.php|.+\.html)(.*)$ {
                                root      /WebRoot/cmy;
                                fastcgi_index    index.php;
                                fastcgi_split_path_info ^(.+\.php)(.*)$;
                                fastcgi_param    SCRIPT_FILENAME    $document_root$fastcgi_script_name;
                                fastcgi_param    PATH_INFO          $fastcgi_path_info;
                                fastcgi_param    PATH_TRANSLATED    $document_root$fastcgi_path_info;
                                fastcgi_pass    127.0.0.1:9000;
                                include    fastcgi.conf;
                                if ($request !~* HEAD(.*)$){
                        #                       access_log  logs/www.log  new_log;
                                }
                           # auth_basic "please enter password";
                           # auth_basic_user_file  /chinasofti/server/nginx/conf/vhosts/nginx_adminpasswd.pl;
                }




    #location ~ \.php$ {
            #root           /WebRoot/cmy;
            #fastcgi_pass   127.0.0.1:9000;
            #index          index.php,index.html;
            #try_files $uri $uri/ /index.php?s=$uri;
            #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
         #  #include        fastcgi_params;
            #include        fastcgi.conf;
        #}

    }
}
//==============      ====================//

좋은 웹페이지 즐겨찾기