#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;
client_max_body_size 20M; #修改此处上传大小为自己实际需要的大小
#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 www.yhuweb.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root D:/wnmp/www;
index index.html index.php;
# if (-f $request_filename) {
# expires max;
# break;
# }
# if (!-e $request_filename) {
# rewrite ^/(.*)$ /index.php/$1 last;
# }
}
#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 D:/wnmp/www;
}
# 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 /phpmyadmin {
alias D:/wnmp/www/phpmyadmin;
index index.php;
}
location ~ \.php$ {
root D:/wnmp/www;
fastcgi_pass 127.0.0.1:9090;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME D:/wnmp/www$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
*********************************************************
这是我的nginx全部配置。
$config['base_url'] = 'http://'.$_SERVER['HTTP_HOST'].'/play_ci';
ci命名为play_ci,放在根目录下;
$config['uri_protocol'] = 'AUTO';
AUTO和REQUEST_UR设置I都试过了;
$route['default_controller'] = 'cismarty';routes.php下默认控制器的配置
*********************************************************
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Cismarty extends CI_Controller {
function __construct()
{
parent::__construct();
}
function index()
{
$this->test();
}
public function test()
{
$this->tpl->assign("content","恭喜你smarty安装成功!");
$this->tpl->display('smarty_view.html');
}
}
这是我自定义的控制器代码;
自己在浏览器中访问时
http://www.yhuweb.com/play_ci/index.php/cismarty/test
结果是404 Not Found |