Nginx服务配置文件介绍
LNMP架构应用实战——Nginx服务配置文件介绍
nginx的配置文件比较简单,但功能相当强大,可以自由灵活的进行相关配置,因此,还是了解下其配置文件的一此信息
1、Nginx服务目录结构介绍
安装完成后,在安装路径下就会有Nginx目录信息
[root@centos6 application]# tree nginx
nginx
+-- client_body_temp
+-- conf #nginx服务配置文件目录
¦ +-- fastcgi.conf #fastcgi配置文件
¦ +-- fastcgi.conf.default
¦ +-- fastcgi_params #fastcgi参数配置文件
¦ +-- fastcgi_params.default
¦ +-- koi-utf
¦ +-- koi-win
¦ +-- mime.types
¦ +-- mime.types.default
¦ +-- nginx.conf #nginx服务的主配置文件
¦ +-- nginx.conf.default #nginx服务的默认配置文件
¦ +-- scgi_params
¦ +-- scgi_params.default
¦ +-- uwsgi_params
¦ +-- uwsgi_params.default
¦ +-- win-utf
+-- fastcgi_temp
+-- html #编译安装nginx默认的首页配置文件目录
¦ +-- 50x.html #错误页面配置文件
¦ +-- index.html #默认的首页配置文件
¦ +-- index.html.bak
+-- logs #日志配置文件目录
¦ +-- access.log #访问日志文件
¦ +-- error.log #错误日志文件
+-- proxy_temp
+-- sbin #命令目录
¦ +-- nginx #Nginx服务启动命令
+-- scgi_temp #临时目录
+-- uwsgi_temp
2、Nginx服务主配置文件介绍
[root@centos6 conf]# egrep -v "#|^$" nginx.conf
worker_processes 1; #工作进程数
events { #事件
worker_connections 1024; #并发数,单位时间内最大连接数
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server { #虚拟主机标签
listen 80; #监听的端口号
server_name localhost; #服务器主机名
location / {
root html; #默认站点目录
index index.html index.htm; #默认首页文件
}
error_page 500 502 503 504 /50x.html; #错误页面文件
location = /50x.html {
root html;
}
}
}
3、Nginx服务帮助信息
[root@centos6 conf]# /application/nginx/sbin/nginx -h
nginx version: nginx/1.10.1 #版本信息
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]
Options:
-?,-h : this help
-v : show version and exit
#显示版本并退出
-V : show version and configure options then exit
#显示版本信息与配置后退出
-t : test configuration and exit
#检查配置(检查语法)
-T : test configuration, dump it and exit
-q : suppress non-error messages during configuration testing
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /application/nginx-1.10.1/)
-c filename : set configuration file (default: conf/nginx.conf)
#指定配置文件,而非使用nginx.conf
-g directives : set global directives out of configuration file
4、nginx编译参数查看
[root@centos6 conf]# /application/nginx/sbin/nginx -v
nginx version: nginx/1.10.1
[root@centos6 conf]# /application/nginx/sbin/nginx -V
nginx version: nginx/1.10.1
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments:
--user=nginx
--group=nginx
--prefix=/application/nginx-1.10.1
--with-http_stub_status_module
--with-http_ssl_module
-with-pcre=/download/tools/pcre-8.38
实际生产环境比较实用的查看参数,比如服务非你自己所安装,但又没有相关文档参考,此参数可以提供一些相关的信息
Nginx服务配置文件介绍的更多相关文章
- linux运维、架构之路-Nginx服务
一.Nginx服务 1.介绍 Nginx软件常见的使用方式或架构为:LNMP(linux nginx mysql php),Nginx三大主要功能,web网站服务,反向代理负载均衡(n ...
- 9. nginx服务实验笔记
LNMP安装与配置 Nginx与apache.lighttp性能综合对比,如下图: 一.系统需求: CentOS/RHEL/Fedora/Debian/Ubuntu系统 需要3GB以上硬盘 ...
- Nginx 配置文件介绍
目录 1.1 常用命令 1.2 Nginx的配置文件结构 1.3 Nginx的全局配置 1.4 HTTP服务器配置 1.5 HttpGzip配置 1.6 负载均衡配置 1.7 server虚拟主机配置 ...
- Nginx 服务介绍
目录 静态 / 动态 Web 服务 Nginx 简介 Nginx 的优点 Nginx 和 Apache 的比较 Nginx 的安装 Nginx 相关文件 Nginx 主配置文件 Nginx 虚拟主机配 ...
- nginx服务部署 说明
第1章 常用的软件 1.1 常用来提供静态服务的软件 Apache :这是中小型Web服务的主流,Web服务器中的老大哥, Nginx :大型网站Web服务的主流,曾经Web服务器中的初生牛犊 ...
- Nginx服务编译安装、日志功能、状态模块及访问认证模式实操
系统环境 [root@web ~]# cat /etc/redhat-release CentOS release 6.9 (Final) [root@web ~]# uname -a Linux d ...
- 3.Nginx常用功能介绍
Nginx常用功能介绍 Nginx反向代理应用实例 反向代理(Reverse Proxy)方式是指通过代理服务器来接受Internet上的连接请求,然后将请求转发给内部网络上的服务器,并且从内部网络服 ...
- Nginx(二)------nginx.conf 配置文件
上一篇博客我们将 nginx 安装在 /usr/local/nginx 目录下,其默认的配置文件都放在这个目录的 conf 目录下,而主配置文件 nginx.conf 也在其中,后续对 nginx 的 ...
- Nginx核心配置文件常用参数详解
Nginx核心配置文件常用参数详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 关于Nginx权威文档的话童鞋们可以参考Nginx官方文档介绍:http://nginx.org/ ...
随机推荐
- iOS - 外加字体(只需三步-教你轻松实现)
外加字体 1.首先info.plist中加入属性Fonts provided by application,在item 0 处填写导入的ttf文件名 eg: <key>UIAppFonts ...
- python day4 元组/字典/集合类知识点补充
目录 python day4 元组/字典/集合类知识点补充 1. 元组tuple知识点补充 2. 字典dict的知识点补充 3. 基本数据类型set 4. 三元运算,又叫三目运算 5. 深复制浅复制 ...
- React Native 开发豆瓣评分(四)集中管理 fetch 数据请求
豆瓣评分的API接口 接口是从网上查找的,看样子应该是微信小程序里面扣出来的(ua 里面有 wechatdevtools) 接口都需要设置apiKey(054022eaeae0b00e0fc068c0 ...
- 自制php操作mysql工具类(DB.class.php)
DB.class.php <?php class DB{ //主机地址 var $host; //用户名 var $username; //密码 var $password; //数据库名 va ...
- Python日记(二):Python之禅
The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Si ...
- 交互式计算引擎MOLAP篇
交互式计算引擎MOLAP篇 摘自:<大数据技术体系详解:原理.架构与实践> MOLAP是一种通过预计算cube方式加速查询的OLAP引擎,它的核心思想是“空间换时间”,典型代表包括Drui ...
- Lenet5设计理解——咬文嚼字系列
最近在看lecun大神的这篇经典文章:“Gradient-Based Learning Appliedto Document Recognition”,文章较老,但是对于lenet5的一些基础概念讲解 ...
- 2018-2019 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2018)-E. Explosion Exploit-概率+状压dp
2018-2019 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2018)-E. Explosion Exploit-概率+状压dp [P ...
- pytest使用
安装: pip install pytest pip install pytest-cov utils.py代码 def add(a, b): return a+b def inc(x): retur ...
- Java精通并发-自旋对于synchronized关键字的底层意义与价值分析以及互斥锁属性详解与Monitor对象特性解说【纯理论】
自旋对于synchronized关键字的底层意义与价值分析: 对于synchronized关键字的底层意义和价值分析,下面用纯理论的方式来对它进行阐述,自旋这个概念就会应运而生,还是很重要的,下面阐述 ...