Nginx编译参数详解

Nginx编译参数

1.当我们安装好nginx后,输入命令  nginx -V 可以看到nginx的编译参数信息,例如 如下图

2. 编译参数如下图
# Nginx安装目的目录或路径
--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 
--pid-path=/var/run/nginx.pid 
--lock-path=/var/run/nginx.lock 

# 执行对应模块时,Nginx所保留的临时性文件
--http-client-body-temp-path=/var/cache/nginx/client_temp 
--http-proxy-temp-path=/var/cache/nginx/proxy_temp 
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp 
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp 
--http-scgi-temp-path=/var/cache/nginx/scgi_temp 

# Nginx服务启动时的用户和用户组
--user=nginx 
--group=nginx 

# 设置额外的参数将被添加到CFLAGS变量
--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'


posted @ 2018-01-17 20:14  风中追风_lonely  阅读(333)  评论(0)    收藏  举报