Nginx配置文件与编译参数

Nginx配置文件与编译参数

    • 配置文件
    • 编译参数
      • 基本配置
      • 模块类

配置文件

rpm -ql nginx

##日志轮转
	/etc/logrotate.d/nginx
##总配置文件
	/etc/nginx/nginx.conf
##子配置文件夹		
	/etc/nginx/conf.d
##默认的网站配置文件		 
	/etc/nginx/conf.d/default.conf 
##动态网站模块文件-python,php所需的相关变量		
	/etc/nginx/fastcgi_params 
##cgi 配置相关,fastcgi 配置		
	/etc/nginx/scgi_params 
    /etc/nginx/uwsgi_params
##字符集,文件编码
	/etc/nginx/koi-utf
##编码转换映射文件		
	/etc/nginx/win-utf
    /etc/nginx/koi-win
##文件关联程序:网站文件类型 和 相关处理程序
	/etc/nginx/mime.types 
##模块文件夹。第三方模块		
	/etc/nginx/modules 
##主配置		
	/etc/nginx/nginx.conf
##用于配置出系统守护进程管理器管理方式		 
	/etc/sysconfig/nginx
		# Configuration file for the nginx service.
		NGINX=/usr/sbin/nginx
		CONFFILE=/etc/nginx/nginx.conf
	/etc/sysconfig/nginx-debug
		# Configuration file for the nginx-debug service.
		NGINX=/usr/sbin/nginx-debug
		CONFFILE=/etc/nginx/nginx.conf
		LOCKFILE=/var/lock/subsys/nginx-debu
##nginx调试程序启动脚本
	/usr/lib/systemd/system/nginx-debug.service
##服务脚本		
	/usr/lib/systemd/system/nginx.service systemctl
##主程序		 
	/usr/sbin/nginx 
##nginx调试程序		
	/usr/sbin/nginx-debug		
##手册和帮助文件
	/usr/share/doc/nginx-1.12.1
    /usr/share/doc/nginx-1.12.1/COPYRIGHT
	/usr/share/man/man8/nginx.8.gz
    /usr/share/nginx
	/usr/share/nginx/html
	/usr/share/nginx/html/50x.html
##默认主页
	/usr/share/nginx/html/index.html
##各种缓存		
	/var/cache/nginx	
##日志文件夹
	/var/log/nginx	
##模块目录
    /usr/lib64/nginx
		

编译参数

基本配置

##配置参数./configure --help查询帮助
	configure arguments: 
##安装路径		
	--prefix=/etc/nginx
##程序文件	 
	--sbin-path=/usr/sbin/nginx
##模块路径		 
	--modules-path=/usr/lib64/nginx/modules
##主配置文件		 
	--conf-path=/etc/nginx/nginx.conf
##错误日志		 
	--error-log-path=/var/log/nginx/error.log
##访问日志		 
	--http-log-path=/var/log/nginx/access.log
##程序ID		 
	--pid-path=/var/run/nginx.pid
##锁路径,防止重复启动nginx		 
	--lock-path=/var/run/nginx.lock
##缓存		 
	--http-client-body-temp-path=/var/cache/nginx/client_temp
##代理缓存		 
	--http-proxy-temp-path=/var/cache/nginx/proxy_temp
##php缓存		 
	--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
##设置 uWSGI 临时文件的目录		 
	--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
##设置 SCGI 临时文件的目录		  
	--http-scgi-temp-path=/var/cache/nginx/scgi_temp
##启用动态模块兼容性 
	--with-compat 
##用户		
	--user=nginx 
##组		
	--group=nginx 
	 

模块类

##使用nginx的aio特性会大大提高性能,比如图片站的特点是大量的读io操作,nginx aio不用等待每次io的结果,有助于并发处理大量io和提高nginx处理效率。
##aio的优点就是能够同时提交多个io请求给内核,然后直接由内核的io调度算法去处理这些请求(directio),这样的话,内核就有可能执行一些合并,节约了读取文件的处理时间。
##就是异步非阻塞
    --with-file-aio 
##多线程模块		
	--with-threads 
##响应之前或者之后追加文本内容,比如想在站点底部追加一个js广告或者新增的css样式		
	--with-http_addition_module
##认证模块
	--with-http_auth_request_module
##增加上传PUT,DELETE,MKCOL:创建集合,COPY和MOVE方法)默认情况下为关闭		 
	--with-http_dav_module 
##NGINX 添加MP4、FLV视频支持模块		
	--with-http_flv_module 
##压缩模块		
	--with-http_gunzip_module
##预读gzip功能		 
	--with-http_gzip_static_module 
##多媒体模块
	--with-http_mp4_module 
##nginx显示随机首页模块		
	--with-http_random_index_module 
##Nginx获取真实IP模块		
	--with-http_realip_module 
##nginx安全下载模块		
	--with-http_secure_link_module 
##nginx中文文档		
	--with-http_slice_module 
##安全模块		
	--with-http_ssl_module
##访问状态		 
	--with-http_stub_status_module
##nginx替换网站响应内容		 
	--with-http_sub_module 
##nginx http2.0版本	
	--with-http_v2_module
##邮件客户端
	--with-mail
#向邮件代理服务器添加SSL/TLS协议支持。默认情况下未构建此模块。需要OpenSSL库来构建和运行此模块		 
	--with-mail_ssl_module 
##负载均衡模块。1.9.0开始,新增加了一个stream模块,用来实现四层协议的转发、代理或者负载均衡等。
	--with-stream
##该模块将客户端地址更改为PROXY协议标头中发送的地址。默认情况下未构建此模块		
	--with-stream_realip_module 
##该模块向流模块添加SSL/TLS协议支持。默认情况下未构建此模块。需要OpenSSL库来构建和运行此模块
	--with-stream_ssl_module	
##该模块允许从ClientHello消息中提取信息,而无需终止SSL/TLS。默认情况下未构建此模块
	--with-stream_ssl_preread_module 
	
##CPU优化参数
	--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --
param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' 
--with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

你可能感兴趣的:(Nginx)