window下phpstudy的nginx配置虚拟主机
由于很长时间没有配置Apache,虽然说知道怎么配置nginx,但是还是花费了一些时间这次记下来下次直接用
在其他选项文件菜单中->打开配置文件->选择vhosts-conf

nginx的话使用

server {
        listen       80;
        server_name  你的虚拟目录名称;
        root   "你要操作的目录路径";
        location / {
            index  index.html index.htm index.php;
            #autoindex  on;
            if ($request_filename !~ (static|robots/.txt|index/.php.*)) {
                rewrite ^/(.*)$ /index.php?$1 last;
                break;
                }
        }
        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;
        }
}

之后最重要一点就是DNS解析了:在C:\Windows\System32\drivers\etc下打开hosts
加入你配置的域名解析到本地的代码例如
127.0.0.1 localhost 这个是默认有的
127.0.0.1 www.mycomment.com
apache的虚拟主机的话代码可以参考

<VirtualHost *:80>
ServerAdmin fudesign2008@163.com
DocumentRoot "F:\workspace\vim\YNote\src"
ServerName editor.fuyg.cn
ServerAlias editor.fuyg.cn
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" combined
<Directory "F:\workspace\vim\YNote\src">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

window下phpstudy的nginx配置虚拟主机的更多相关文章
- nginx配置虚拟主机vhost的方法详解
		
Nginx vhost配置,可实现基于ip.端口号.servername的虚拟主机,同时可避免直接修改主配置文件.在nginx下配置虚拟主机vhost非常方便.这篇文章主要介绍了nginx配置虚拟主机 ...
 - windows 下 nginx 配置虚拟主机
		
1. 在 nginx 的配置文件 nginx.conf 里面 引入虚拟主机配置文件,以后所有的虚拟主机配置文件都在写这个文件里 include vhost.conf; (或者新建vhost ...
 - nginx  配置虚拟主机
		
文章转载自:http://www.ttlsa.com/html/1571.html 上篇说道我们的nginx是安装在/usr/local/nginx/ cd conf 我们现在把所有的虚拟主机放在一个 ...
 - centos5.5用phpstudy一键安装配置虚拟主机后,yum配置代理服务器squid
		
最近因为工作需要,开发站点需要在lamp环境下跑网站,于是在win7上跑虚拟机装了一个centos5.5的linux 并用集成环境配置了一个lamp环境,这里用的是phpstudy的一键安装包,并配置 ...
 - nginx 配置虚拟主机的三种方法
		
nginx,一个server标签就是一个虚拟主机. 1.基于域名的虚拟主机,通过域名来区分虚拟主机——应用:外部网站 2.基于端口的虚拟主机,通过端口来区分虚拟主机——应用:公司内部网站,外部网站的管 ...
 - nginx 配置虚拟主机( 基于端口 )
		
一.创建网站目录及文件: [root@localhost data]# tree /data /data └── wwwroot ├── www.1.com_8080 │ └── index.ht ...
 - nginx 配置虚拟主机( 基于域名 )
		
一.创建网站目录及文件: [root@localhost data]# tree /data /data └── wwwroot ├── www..com │ └── index.html └── ...
 - nginx配置虚拟主机、反向代理和负载均衡
		
为了实现这个功能,需要修改nginx的配置文件,将nginx.conf清理一下,使结构更清晰. worker_processes ; events { worker_connections ; } h ...
 - nginx配置虚拟主机之不同端口和不同IP地址
		
配置nginx虚拟主机不同端口和不同ip地址,和上编nginx基于域名配置虚拟主机博文类似,请先参考. zxl.com域名不同端口,配置文件内容如下: 1 2 3 4 5 6 7 8 9 10 11 ...
 
随机推荐
- 笔记-测试崩溃之memcpy_s
			
昨天晚上提测,今天早上测试发来贺电,程序崩溃!!!!!! 而问题出在memcpy_s errno_t memcpy_s( void *dest, size_t numberOfElements, co ...
 - Java就业企业面试问题-ssh框架
			
SSH框架阶段SSH的优缺点,使用场景? Hibernate优点: (1) 对象/关系数据库映射(ORM) 它使用时只需要操纵对象,使开发更对象化,抛弃了数据库中心的思想,完全的面向对象思想 ...
 - 数据分析基础之Linalg的使用
			
Linear algebra 简介 When SciPy is built using the optimized ATLAS LAPACK and BLAS libraries, it has ve ...
 - 理解typename的两个含义
			
理解typename的两个含义 问题:在下面的 template declarations(模板声明)中 class 和 typename 有什么不同? template<class T> ...
 - poj 2459 Sumsets
			
Sumsets Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11612 Accepted: 3189 Descript ...
 - Uncle Tom's Inherited Land*
			
Uncle Tom's Inherited Land* Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java ...
 - A Walk Through the Forest
			
A Walk Through the Forest Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/O ...
 - EasyUI实现购物车、菜单和窗口栏等最常用的用户界面功能
			
一.EasyUI jQuery EasyUI 是一个基于 jQuery 的框架,集成了各种用户界面插件. easyui 提供建立现代化的具有交互性的 javascript 应用的必要的功能. 使用 e ...
 - 深入分析Android动画(二)
			
上回书说到Android动画的分类以及基本使用,这会书主要说Android属性动画的原理,对于View动画的原理本篇不做深入分析.对于Android动画的基础请看深入分析Android动画(一) 我们 ...
 - An explicit value for the identity column in table can only be specified when a column list is used and IDENTITY_INSERT is ON
			
If you run into the following error message: An explicit value for the identity column in table '< ...