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服务配置文件介绍的更多相关文章

  1. linux运维、架构之路-Nginx服务

    一.Nginx服务 1.介绍         Nginx软件常见的使用方式或架构为:LNMP(linux nginx mysql php),Nginx三大主要功能,web网站服务,反向代理负载均衡(n ...

  2. 9. nginx服务实验笔记

    LNMP安装与配置   Nginx与apache.lighttp性能综合对比,如下图:     一.系统需求: CentOS/RHEL/Fedora/Debian/Ubuntu系统 需要3GB以上硬盘 ...

  3. Nginx 配置文件介绍

    目录 1.1 常用命令 1.2 Nginx的配置文件结构 1.3 Nginx的全局配置 1.4 HTTP服务器配置 1.5 HttpGzip配置 1.6 负载均衡配置 1.7 server虚拟主机配置 ...

  4. Nginx 服务介绍

    目录 静态 / 动态 Web 服务 Nginx 简介 Nginx 的优点 Nginx 和 Apache 的比较 Nginx 的安装 Nginx 相关文件 Nginx 主配置文件 Nginx 虚拟主机配 ...

  5. nginx服务部署 说明

    第1章 常用的软件 1.1 常用来提供静态服务的软件   Apache :这是中小型Web服务的主流,Web服务器中的老大哥,   Nginx :大型网站Web服务的主流,曾经Web服务器中的初生牛犊 ...

  6. Nginx服务编译安装、日志功能、状态模块及访问认证模式实操

    系统环境 [root@web ~]# cat /etc/redhat-release CentOS release 6.9 (Final) [root@web ~]# uname -a Linux d ...

  7. 3.Nginx常用功能介绍

    Nginx常用功能介绍 Nginx反向代理应用实例 反向代理(Reverse Proxy)方式是指通过代理服务器来接受Internet上的连接请求,然后将请求转发给内部网络上的服务器,并且从内部网络服 ...

  8. Nginx(二)------nginx.conf 配置文件

    上一篇博客我们将 nginx 安装在 /usr/local/nginx 目录下,其默认的配置文件都放在这个目录的 conf 目录下,而主配置文件 nginx.conf 也在其中,后续对 nginx 的 ...

  9. Nginx核心配置文件常用参数详解

    Nginx核心配置文件常用参数详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 关于Nginx权威文档的话童鞋们可以参考Nginx官方文档介绍:http://nginx.org/ ...

随机推荐

  1. springboot整合tkmybatis

    tkmybatis是什么? tkmybatis是为了简化mybatis单表的增删改查而诞生的,极其方便的使用MyBatis单表的增删改查,在使用mybatis单表增删改查时,可以直接调用tkmybat ...

  2. Android 设置横屏

    以下介绍两种方式 1.1 设置清单文件 <activity android:name=".MainActivity" android:screenOrientation=&q ...

  3. 如何通过Restful API的方式读取SAP Commerce Cloud的Product Reference

    从SAP官网上找到api的说明: https://api.sap.com/api/commerce_services/resource api endpoint: /rest/v2/electroni ...

  4. linux时间格式

    date "+%Y-%m-%d %H:%M:%S" 2019-10-27 12:02:33

  5. SpringCloud组件相关

    一.前言 原文地址:https://mp.weixin.qq.com/s/mwn2X0G9UgUDz1sgGgL1mA 认识我的朋友可能都知道我这阵子去实习啦,去的公司说是用SpringCloud(但 ...

  6. hdu6715 算术 2019百度之星初赛3-1003

    题目地址 http://acm.hdu.edu.cn/showproblem.php?pid=6715 题解 还是不会这题的容斥做法qwq.hjw当场写了个容斥A了.我推了个莫反,但是没反应过来我的式 ...

  7. jupytext library using in jupyter notebook

    目录 1. jupytext features 2. Way of using 3. usage 4. installation 1. jupytext features Jupytext can s ...

  8. 使用Nuget生成类库

     背景: 为了开始ITOO项目,我们先学习了一些基本知识,这些就是一个基本知识,这实现的是一种封装的思想,将方法打包,这样我们就可以在其他系统中直接引用而需要再耗费人力和财力去做,真正实现了高效率 ...

  9. LG4762 Virus synthesis

    Virus synthesis 初始有一个空串,利用下面的操作构造给定串 S . 串开头或末尾加一个字符 串开头或末尾加一个该串的逆串 求最小化操作数, ∣S∣≤105 . 题解 显然应该多使用操作2 ...

  10. 神经网络(9)--如何求参数: backpropagation algorithm(反向传播算法)

    Backpropagation algorithm(反向传播算法) Θij(l) is a real number. Forward propagation 上图是给出一个training examp ...