nginx.conf文件说明
#Nginx所有用户和组,window下不指定
#user nobody; #工作的子进程数量(通常等于CPU数量或者2倍于CPU)
worker_processes 1; #错误日志存放路径
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #指定pid(进程id)存放文件
#pid logs/nginx.pid; #执行的事件
events {
#允许最大连接数
worker_connections 51200;
} http {
# MIME类型就是设定某种扩展名的文件用一种应用程序来打开的方式类型
include mime.types;
#默认类型——八字节数据流
default_type application/octet-stream; #定义日志格式
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; #生成日志
#access_log logs/access.log main; #发送文件
sendfile on;
#打开tcp通道
#tcp_nopush on; #活动时间
#keepalive_timeout 0;
keepalive_timeout 65; #打开gzip数据流压缩
#gzip on; #对于服务的配置
server {
#端口号(如果你本地安装了其他Web服务器,为了避免冲突,这里需要修改)
listen 80;
#服务名,本地或者www.abc.com *.abc.com
server_name localhost;
#设置字符集
#charset koi8-r;
#打日志
#access_log logs/host.access.log main; location / {
root html;
index index.html index.htm;
} #错误页定义
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#}
}
nginx.conf文件说明的更多相关文章
- 借用nginx.vim工具进行语法高亮和格式化配置nginx.conf文件
在生产环境中,我们肯定经常用到nginx.conf文件的编排工作,今天在阅读<决战nginx>的时候无意间看到nginx.vim这个辅助工具,于是百度搜索和实际部署检测了一下,其效果确实让 ...
- 虚拟主机ip配置,nginx.conf文件配置及日志文件切割
今天粗略整理了一下虚拟主机配置,nginx.conf文件的配置,及日志文件的切割,记录如下: nginx虚拟主机配置:1.IP地址配置,2.绑定ip地址和虚拟主机详情:1.ip地址的配置:ifconf ...
- Dockerfile + Nginx.conf文件记录(用于前端项目部署)
Dockerfile + Nginx.conf文件记录(用于前端项目部署) 本教程依据个人理解并经过实际验证为正确,特此记录下来,权当笔记. 注:基于linux操作系统(敏感信息都进行了处理),默认服 ...
- 在k8s中将nginx.conf文件内容创建为ConfigMap挂载到pod容器中
将nginx.conf文件内容创建为ConfigMap user nginx; worker_processes auto; error_log /var/log/nginx/error.log er ...
- docker+nginx搭建tomcat集群(附录)——nginx.conf文件
附录:nginx.conf修改后的文件内容 user root;worker_processes 2; #error_log logs/error.log;#error_log logs/error. ...
- nginx conf 文件
server { listen ; server_name local.light.com; index index.html index.htm index.php; root /home/wwwr ...
- 详解nginx.conf文件配置项(包括负载均衡)
http://www.cnblogs.com/hsapphire/archive/2010/04/08/1707109.html #运行用户 user nobody nobody; #启动进程 wo ...
- nginx.conf文件
user www www; worker_processes auto; error_log /home/wwwlogs/nginx_error.log crit; pid /us ...
- nginx.conf文件配置明细详解
#etnx运行的用户和用户组 user nginx nginx; #工作进程数,建议设置为CPU的总核数 worker_processes ; #全局错误日志定义类型,日志等级从低到高依次为: #de ...
随机推荐
- position:absolute和float会隐式的改变display类型
position:absolute和float会隐式的改变display类型,不论之前是什么类型的元素(display:none除外),只要设置了position:absolute或float,都会让 ...
- jqGrid学习笔记(二)
本节介绍jqGrid其他的使用方法,主要是一些基本操作,特殊的数据显示等. 1 刷新jqGrid数据. 常用到刷新jqGrid数据的情况是,在用到查询的时候,根据查询条件,请求数据,并刷新jqGrid ...
- .Net的错误机制
//优先级1 protected void Page_Error(object sender, EventArgs e) { Exception objErr = Serv ...
- python获取DBLP数据集
#!/usr/bin/python # -*- coding: UTF-8 -*- import xml.sax import io, sys paper_tags = ('article', 'in ...
- Java写操作
//:ThinkingInJava/net.mindview.io/write2File.java package net.mindview.io; import java.io.BufferedRe ...
- Java 技术体系图
Java 程序员 高级特性 反射.泛型.注释符.自动装箱和拆箱.枚举类.可变 参数.可变返回类型.增强循环.静态导入 核心编程 IO.多线程.实体类. 集合类.正则表达式. XML 和属性文件 图形编 ...
- php session的存放目录,再次回顾
session的存放位置可以通过运行时配置ini_set和函数session_save_path来设置 .session_save_path - 读取/设置当前会话的保存路径 string sessi ...
- vim global命令
global命令格式 : [range]global/{pattern}/{command} global命令在[range]指定的文本范围内(缺省为整个文件)查找{pattern},然后对匹配到的行 ...
- [linux]树莓派入手体验和系统安装
背景 一直想捣鼓点什么东西.当看到树莓派的时候,就是它了. 树莓派可以安装Linux系统,而我在工作当中,可以说Linux是一半工作环境.树莓派真是个好东西,这个东西应该在我学习linxu/Unix的 ...
- linux下实时查看tomcat运行日志
查看实时日志: tail -f catalina.out Ctrl+c 是退出tail命令