美文网首页
nginx项目的发布

nginx项目的发布

作者: 简约时尚fyy | 来源:发表于2017-06-14 19:34 被阅读0次

server {

    listen      80 ;

    server_name  www.host1.cc; #监听的hostname

    root  /var/www/www_host1_cc/; #第一个项目的根目录

    location / {

        root  /var/www/www_host1_cc/;

        index  index.php index.html index.htm;

    }

    error_page  404              /404.html;

    location = /404.html {

        root  /usr/share/nginx/html;

    }

    error_page  500 502 503 504  /50x.html;

    location = /50x.html {

        root  /usr/share/nginx/html;

    }

    location ~ .*\.(php|php5)?(\/.*)*$ {

        fastcgi_pass 127.0.0.1:9000;

        fastcgi_index index.php;

        set $path_info "";

                set $real_script_name $fastcgi_script_name;

                if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {

                        set $real_script_name $1;

                        set $path_info $2;

                }

        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

        fastcgi_param SCRIPT_NAME $real_script_name;

                fastcgi_param PATH_INFO $path_info;

            include    fastcgi_params;

    }

}

相关文章

网友评论

      本文标题:nginx项目的发布

      本文链接:https://www.haomeiwen.com/subject/yjseqxtx.html