nginx虚拟主机配置

来源:互联网 发布:根域名是什么 编辑:程序博客网 时间:2024/06/03 23:43

1.F:\phpStudy\nginx\conf  

nginx.conf     最后一句 加上        include vhosts/*.conf;  



2.     F:\phpStudy\nginx\conf\vhosts   下加所有的虚拟主机配置    以  .conf结尾

eg :


# 全屋优品PC商城server {    listen       80;    server_name  admin.q.com;    root   "E:\www\qwyp_admin\webroot";    location / {        if (!-e $request_filename) {            rewrite ^(.*)$ /index.php$1 last;        }    }        error_page  404              /404.html;    # redirect server error pages to the static page /50x.html    error_page   500 502 503 504  /50x.html;    location = /50x.html {        root   html;    }    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000    location ~ \.php(.*)$  {        fastcgi_pass   127.0.0.1:9000;        fastcgi_index  index.php;        fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;        fastcgi_param  PATH_INFO  $fastcgi_path_info;        fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;        include        fastcgi_params;    }    # deny access to .htaccess files, if Apache's document root    # concurs with nginx's one    #location ~ /\.ht {    #    deny  all;    #}}



1 0
原创粉丝点击