linux 中安装nginx 的虚拟主机

来源:互联网 发布:室内手机手绘软件 编辑:程序博客网 时间:2024/06/05 18:53
直接将一下代码粘贴到nginx的配置文件的

 #location ~ /\.ht {
        #    deny  all;
        #}
    }
的下面

server {
         listen       80;
         server_name  域名;
         location / {
            root   根目录;
            index  index.html index.htm index.php;
         }
         location ~ \.php$ {
           root 根目录;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

         #location ~ /.ht {
          #  deny  all;
         #}

      }


之后重启nginx  重启 php-fpm



0 0
原创粉丝点击