当前位置: > Linux服务器 > nginx >

nginx配置cakephp实现伪静态

时间:2014-12-08 12:08来源:linux.it.net.cn 作者:IT
server {

    listen   80;

    server_name www.it.net.cn;

    rewrite ^(.*) http://it.net.cn$1 permanent;

}
server {

    listen   80;

    server_name it.net.cn;

    # root directive should be global

    root   /var/www/it.net.cn/public/app/webroot/;

    access_log /var/www/it.net.cn/log/access.log;

    error_log /var/www/it.net.cn/log/error.log;

    location / {

        index  index.php index.html index.htm;

        try_files $uri $uri/ /index.php?$uri&$args;

    }

    location ~ \.php$ {

        include /etc/nginx/fcgi.conf;

        fastcgi_pass    127.0.0.1:10005;

        fastcgi_index   index.php;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    }

}



(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容