本文共 946 字,大约阅读时间需要 3 分钟。
1) 进入nginx 配置目录: linuxidc@www.linuxidc.com ~ $ cd /usr/local/nginx/conf/
2) 查看目录文件: linuxidc@www.linuxidc.com /usr/local/nginx/conf $ ll
3) 虚拟目录配置文件夹 linuxidc@www.linuxidc.com /usr/local/nginx/conf $ cd sites-enabled/ 4) 查看已配置的虚拟目录 linuxidc@www.linuxidc.com /usr/local/nginx/conf/sites-enabled $ ll
total 100K
4.0K -rw-r--r-- 1 root root 371 Aug 5 2010 Android.conf
......
5) copy 原有的配置文件
linuxidc@www.linuxidc.com /usr/local/nginx/conf/sites-enabled $ cp chaichunyan.conf chaichunyan.spread.conf
6) 编辑
linuxidc@www.linuxidc.com /usr/local/nginx/conf/sites-enabled $ vi chaichunyan.spread.conf
server {
listen 80;
server_name ccy.spread.dangdang.com;
index index.php;
root [网站根目录路径];
autoindex on;
charset utf-8;
location ~ .*/.php?$ {
include fastcgi.conf;
}
}
7) 重启nginx服务器
linuxidc@www.linuxidc.com /usr/local/nginx/conf/sites-enabled $ su
Password:
root@www.linuxidc.com sites-enabled # service httpd restart
Stop nginx ...
Starting nginx ...
转载地址:http://oqhiv.baihongyu.com/