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. zabbix selinux audit2allow 问题

    he following example demonstrates using audit2allow to create a policy module: A denial and the asso ...

  2. 使用C++为对象分配与释放内存时的几个好习惯

    本文为大便一箩筐的原创内容,转载请注明出处,谢谢:http://www.cnblogs.com/dbylk/ 最近在为公司的项目写内存泄漏定位工具,遇到一些关于C++构造与析构对象的问题,在此记录一下 ...

  3. 利用ModSecurity防御暴力破解

    利用ModSecurity防御暴力破解 from:http://www.freebuf.com/articles/web/8749.html 2013-04-18 共553248人围观 ,发现 12 ...

  4. Vue打包上线部署

    一.路径问题 1.脚手架+webpack打包通过npm run build,但是后台tomcat部署上线的时候,会衍生出一些问题,比如,路径问题(因为在项目中,我们使用了绝对路径,这里必须要使用相对路 ...

  5. C++复习11.函数的高级特性

    C++ 函数的高级特性 20131002 C++函数增加了重载(override), inline, const, virtual四种机制,重载和内联机制既可以用于全局函数,也可以用于类的成员函数.c ...

  6. Prism 4 文档 ---第8章 导航

        作为同用户具有丰富的交互的客户端应用程序,它的用户界面(UI)将会持续不断的更新来反映用户工作的当前的任务和数据.用户界面可以进行一段时间相当大的变化作为用户交互的应用程序中完成各种任务.通过 ...

  7. LeetCode OJ:Find Median from Data Stream(找数据流的中数)

    Median is the middle value in an ordered integer list. If the size of the list is even, there is no ...

  8. LeetCode OJ:ZigZag Conversion(字符串的Z字型转换)

    The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like ...

  9. SpringXML方式给bean初始化属性值

    可以在Spring容器初始化bean的时候给bean的属性赋初始值,直接在property标签里设置即可 1 2 3 4 5 6 <bean name="user**" cl ...

  10. python中pickle模块与base64模块的使用

    pickle模块的使用 pickle模块是python的标准模块,提供了对于python数据的序列化操作,可以将数据转换为bytes类型,其序列化速度比json模块要高. pickle.dumps() ...