您的位置:首页 > 运维架构 > Nginx

nginx虚拟主机的配置

2016-10-20 16:11 246 查看
方法二:配置虚拟主机

直接将一下代码粘贴到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;

         #}

      }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: