1. 进入 /usr/local/nginx/conf/vhost 目录, 创建虚拟主机配置文件 wbs.test.com.conf ({域名}.conf).

2.打开配置文件, 添加服务如下:

log_format wbs.test.com '$remote_addr - $remote_user [$time_local] $request'
'$status $body_bytes_sent $http_referer '
'$http_user_agent $http_x_forwarded_for';

server {
listen 80;
server_name wbs.test.com;
index index.html index.htm index.php;
root /data/www/wbs.test.com;

location ~ .*\.(php|php5)?$ {
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
#include fastcgi_params;
include fastcgi.conf;
}

access_log /data/logs/wbs.test.com-access.log wbs.test.com;
error_log /data/logs/wbs.test.com-error.log notice;
}

3.打开 Nginx 配置文件 /usr/local/nginx/conf/nginx.conf, 在 http 范围引入虚拟主机配置文件如下:

include vhost/*.conf;

4.重启nginx

service nginx restart

												

最新文章

  1. 如何利用sendmail发送外部邮件?
  2. MVC 生成图片,下载文件(图片不存在本地,在网上下载)
  3. 基础知识系列☞IList ←vs→ List
  4. poj 3735 Training little cats 矩阵快速幂+稀疏矩阵乘法优化
  5. i.BIO方式的SSL通道流程
  6. ModelAttribute注解
  7. Linux设备驱动之semaphore机制【转】
  8. openssl数字证书私钥删除私钥密码
  9. JavaScript入门(7)
  10. Ubuntu 批量添加用户
  11. Nginx反代Mogilefs分布式储存示例
  12. Python示例
  13. P1547 Out of Hay
  14. 编程四剑客sed-2019.2.20
  15. Angularjs的directive封装ztree
  16. Redis持久化——AOF
  17. java的跳转和重定向,加载显示层
  18. XML--将XML中数据提取出转换成表
  19. 021.5 IO流——字符流
  20. sql server中index的REBUILD和REORGANIZE的区别及工作方式

热门文章

  1. ICPC2019上海站游记
  2. day 02(作业)
  3. .Net优秀应用界面大PK!DevExpress年度大赛,群雄逐鹿花落谁家
  4. SVG矢量绘图 path路径详解(贝塞尔曲线及平滑)
  5. Django传递数据给JS
  6. 重新梳理一下adb操作app(golang版)
  7. Poj 2165 Milking Grid(kmp)
  8. windows游戏编程X86 (内存)寄存器相关的基本概念
  9. Rand工具类
  10. POJ 3616 Milking Time ——(记忆化搜索)