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;
}
}

nginx虚拟机的配置的更多相关文章

  1. nginx虚拟机配置(支持php)

    由于本人水平有限,以下记录仅作参考. 下面贴出我的一份正常运行的nginx服务器虚拟机配置./usr/local/nginx/conf/vhost/www.xsll.com.conf server { ...

  2. nginx 的基础配置[转]

    nginx 的基础配置 分类: 工具软件2013-11-13 23:26 11人阅读 评论(0) 收藏 举报   目录(?)[-] 管理配置文件 全局配置 虚拟机server配置 location配置 ...

  3. Nginx高性能服务器安装、配置、运维 (5) —— Nginx虚拟主机配置

    六.Nginx虚拟主机配置 建立基于域名的虚拟主机: (1)建立基于域名的虚拟主机配置文件(以abc.com为例): (2)更改虚拟主机配置文件: 更改配置如下(更改部分即可): server { l ...

  4. nginx 2.基本配置

    死磕nginx 2.基本配置 鉴于深入浅出的原理,我们先从一个简单的配置了解nginx的配置 1.一个典型配置 nginx的配置文件默认在nginx安装目录的conf二级目录下面,主配置文件为 ngi ...

  5. Nginx (安装+ 配置域名+ 访问认证 +发布文件)

    一.Nginx介绍: Nginx是一款高性能的HTTP和反向代理服务器,能够选择高效的epoll(linux2.6内核).kqueue(freebsd).eventport(solaris10)作为网 ...

  6. Keepalived保证Nginx高可用配置

    Keepalived保证Nginx高可用配置部署环境 keepalived-1.2.18 nginx-1.6.2 VM虚拟机redhat6.5-x64:192.168.1.201.192.168.1. ...

  7. nginx安装及其配置详细教程

    1 nginx 介绍 1 什么是nginx Nginx是一款高性能的http 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器. 由俄罗斯的程序设计师Igor Sysoev所开发,官方 ...

  8. (转)Nginx静态服务配置---详解root和alias指令

    Nginx静态服务配置---详解root和alias指令 原文:https://www.jianshu.com/p/4be0d5882ec5 静态文件 Nginx以其高性能著称,常用与做前端反向代理服 ...

  9. tomcat+nginx+keepalived的配置

    tomcat+nginx+keepalived的配置 1.在官网上下载Tomcat 2.将压缩包解压,并且移动到/opt/data/的目录下. .tar.gz /opt/data/ 3.进入到Tomc ...

随机推荐

  1. leetcode 427. Construct Quad Tree

    We want to use quad trees to store an N x N boolean grid. Each cell in the grid can only be true or ...

  2. field字段错位手动更改方法

    update tbprotocolex set field='1' where name='ICMP';update tbprotocolex set field='1' where name='DN ...

  3. jquery基础 笔记二

    动态创建元素 关于使用HTML DOM创建元素本文不做详细介绍, 下面举一个简单的例子: //使用Dom标准创建元素 var select = document.createElement(" ...

  4. ios 第2天

    类的方法和实例的方法 -(void)runwithspeed:(int)speed and direction:(int)direction; 实例方法 -开头 运用对象调用 函数名为runwiths ...

  5. mysql数据库的笔记

    增删改查置顶: 插入数据: 基本语法 : insert into [表名](字段名1,字段名2……) values(记录1),(记录2): insert into [表名] values(记录1),( ...

  6. L161

    The robot arm made for gentle undersea explorationA soft robotic arm which will allow underwater sea ...

  7. L157

    UK Watchdog: Smugglers to Exploit Border if no Brexit DealSmugglers and other organized criminals ar ...

  8. 解决错误:This bundle is invalid - The file extension must be .zip

    近期在 iOS 开发中遇到了一个很蛋疼的问题,Xcode 工程中接入了iMessage 壁纸的功能后,每次上传 ipa 包都会显示此包无效,并报上述的错误描述:This bundle is inval ...

  9. CMake入门实践

    为了更好的代码管理,选择一款make工具非常重要,cmake取百家之长,现在在github上已经是工程管理的常客了,最大的优势是跨平台.本文将避开理论,直接教你如何在windows和linux上实现c ...

  10. learn go anonymous function

    package main // 参考文档: // https://github.com/Unknwon/the-way-to-go_ZH_CN/blob/master/eBook/06.8.md im ...