简单实用nginx 配置 本机 虚拟主机 windows 下的。
2014-09-18 16:25
656 查看
这里的前提是配置的 安装好的nginx 已经能够正常使用以及 php能够正常解析
打开 nginx 目录下的 conf 文件夹
打开 nginx.conf 文件
将下列的文字复制一遍,大约是conf文件的 88行开始
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm index.php;
# }
#}
然后去掉前面的 # 号
然后复制自己配置好 php 的那一段,将地址改成自己域名对应的文件夹
server {
listen 80;
server_name d.ms.cn; //自己本机解析配置的域名(在hosts 里改的)
location / {
root D:/wamp/www/z/;
index index.html index.htm index.php;
}
location ~ \.php$ {
root D:/wamp/www/z/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
打开 nginx 目录下的 conf 文件夹
打开 nginx.conf 文件
将下列的文字复制一遍,大约是conf文件的 88行开始
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm index.php;
# }
#}
然后去掉前面的 # 号
然后复制自己配置好 php 的那一段,将地址改成自己域名对应的文件夹
server {
listen 80;
server_name d.ms.cn; //自己本机解析配置的域名(在hosts 里改的)
location / {
root D:/wamp/www/z/;
index index.html index.htm index.php;
}
location ~ \.php$ {
root D:/wamp/www/z/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
相关文章推荐
- nginx/windows: nginx多虚拟主机配置
- Nginx配置一个简单的虚拟主机
- windows 下 nginx 配置虚拟主机
- nginx学习5——配置虚拟主机以,检查nginx配置的方法,windows下的配置
- nginx 的简单配置(虚拟主机、来源控制、https)
- Nginx虚拟主机配置实例(Nginx VirtualHost Example)
- windows下配置全能虚拟主机环境案例
- nginx配置虚拟主机
- nginx的基本配置和虚拟主机的配置
- nginx for windows 中虚拟主机路径设置问题
- 【Nginx】配置基于域名的虚拟主机
- windows下配置apache虚拟主机
- windows下apache配置虚拟主机的两个方法
- windows下apache虚拟主机的配置
- Nginx安装配置(含PHP支持、虚拟主机、反向代理负载均衡)
- Nginx 虚拟主机 配置 支持独立urlwrite 文件, php-fpm独立用户和php....
- 有史以来最好的windows 虚拟主机安全配置
- Windows下设置apache虚拟主机配置
- Windows下Apache中配置虚拟主机
- windows和linux下虚拟主机的配置