nginx虚拟机的配置
user nginx nginx;
worker_processes 1;
pid /data/var/run/nginx/nginx.pid;
worker_rlimit_nofile 51200;
events
{
#epoll是多路复用IO中的一种方式
use epoll;
#单个后台的work process进行的最大并发链接数
worker_connections 51200;
}
http{
#设定mime类型,类型由mime.types文件定义
include mime.types;
default_type application/octet-stream;
#设置日志格式
#指定nginx是否调用sendfile来输出文件
sendfile on;
#连接超时时间
keepalive_timeout 60;
tcp_nodelay on;
#声明日志格式,请求的地址,状态,请求ip
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
#设置虚拟主机设置
server{
#侦听80端口
listen 80;
#定义访问域名
server_name lx.workplace.com;
#定义服务器的默认网站根目录位置
root /data/wwwroot/workplace;
#默认请求
location / {
#定义首页索引文件名称
index index.php index.html index.htm;
}
#设置php脚本请求全部转发到fastcgi处理
location ~ .php$ {
#fastcgi端口
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi路径
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
#设置日志
access_log /data/wwwlogs/admin.njw88.com/access.log;
error_log /data/wwwlogs/admin.njw88.com/error.log;
}
}
最新文章
- QML 从无到有 3 (自动更新)
- 【caffe】train_lenet.sh在windows下的解决方案
- 排序算法总结(三)选择排序【Select Sort】
- 人工智能深度学习Caffe框架介绍,优秀的深度学习架构
- color 的一些处理
- trigger,triggerhandler模拟事件
- WPF 中资源路径的问题
- 按需讲解之Supervisor
- FastDFS、nginx配置手记
- 自动生成代码工具【JAVA版】
- 虚拟机与Docker有何不同?
- 【PAT】B1010 一元多项式求导
- oracle 与其他数据库如mysql的区别
- 【服务器】Https服务配置
- c++ 的类 和 类继承, 什么是c++中的基类和派生类?
- Adobe漏洞攻击
- windows 和 Linux 安装rabbitmq
- what's RNA-Seq?
- 事后诸葛亮之Alpha十天冲刺之失败总结
- zend opcache的最佳设置