牛骨文教育服务平台(让学习变的简单)
博文笔记

nginx配置www.conf

创建时间:2015-06-30 投稿人: 浏览次数:1241
server {
        listen          80 default;
        root /home/www/www;
        index index.php;
        #server_name 120.26.118.85;
        server_name www.fangpinhui.com fangpinhui.com *.fangpinhui.com;
        location / {
                index  index.htm index.html index.php;
                if (!-e $request_filename) {
                        rewrite  ^/(.*)$  /index.php/$1  last;
                         break;
                }
        }
        location ~ .php/?.*$ {
                root        /home/www/www;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                include /etc/nginx/fastcgi_params;

                set $fastcgi_script_name2 $fastcgi_script_name;
                if ($fastcgi_script_name ~ "^(.+.php)(/.+)$") {
                        set $fastcgi_script_name2 $1;
                        set $path_info $2;
                }

                fastcgi_param   PATH_INFO $path_info;
                fastcgi_param   SCRIPT_FILENAME   $document_root$fastcgi_script_name;
                fastcgi_param   SCRIPT_NAME   $fastcgi_script_name2;
        }
}

声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。