2168575 发表于 2016-12-26 12:15:13

ci 框架 nginx 重定向配置

#usernobody;
worker_processes1;

#error_loglogs/error.log;
#error_loglogs/error.lognotice;
#error_loglogs/error.loginfo;

#pid      logs/nginx.pid;


events {
    worker_connections1024;
}


http {
    include       mime.types;
    default_typeapplication/octet-stream;

    #log_formatmain'$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_loglogs/access.logmain;

    sendfile      on;
    #tcp_nopush   on;

    #keepalive_timeout0;
    keepalive_timeout65;

    #gzipon;

    server{
      listen       8003;
      server_namelocalhost;
      location / {
            index index.html index.htm index.php;

            roothtml;
            rewrite ^/$ /index.php last;
            rewrite ^/(?!index\.php|robots\.txt|uploadedImages|resource|images|js|css|styles|static)(.*)$ /index.php/$1 last;
      }
      location ~ ^(.+\.php)(.*)$
      {
      fastcgi_pass127.0.0.1:9000;
      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;
      include      fastcgi_params;
      include      fastcgi.conf;
      }

      log_formatwwwlogs'$remote_addr - $remote_user [$time_local] "$request" '
            '$status $body_bytes_sent "$http_referer" '
            '"$http_user_agent" $http_x_forwarded_for';
      access_loglogs/wwwlogs.logwwwlogs;
    }



}
页: [1]
查看完整版本: ci 框架 nginx 重定向配置