./configure \
–prefix=/usr/local/nginx \
–pid-path=/var/run/nginx/nginx.pid \
–lock-path=/var/lock/nginx.lock \
–error-log-path=/var/log/nginx/error.log \
–http-log-path=/var/log/nginx/access.log \
–http-client-body-temp-path=/var/tmp/nginx/client \
–http-proxy-temp-path=/var/tmp/nginx/proxy \
–http-fastcgi-temp-path=/var/tmp/nginx/fcgi \
–http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
–http-scgi-temp-path=/var/tmp/nginx/scgi \
–with-pcre \
–with-http_v2_module \
–with-http_ssl_module \
–with-http_realip_module \
–with-http_addition_module \
–with-http_sub_module \
–with-http_dav_module \
–with-http_flv_module \
–with-http_mp4_module \
–with-http_gunzip_module \
–with-http_gzip_static_module \
–with-http_random_index_module \
–with-http_secure_link_module \
–with-http_stub_status_module \
–with-http_auth_request_module \
–with-mail \
–with-mail_ssl_module \
–with-file-aio \
–with-ipv6 \
–with-http_v2_module \
–with-threads \
–with-stream \
–with-stream_ssl_module
注:\ 代表在命令行中换行,用于提高可读性
命令 | 解释 |
---|
–prefix | nginx的安装目录,默认为/usr/local/nginx |
–sbin-path | nginx可执行文件路径,若没有设置则依赖于–prefix |
–conf-path | 设置nginx.conf配置文件路径,若没有设置则依赖于–prefix,nginx启动时可以通过-c参数指定配置文件 |
–error-log-path | 错误日志路径 |
–http-log-path | http主请求日志文件 |
–pid-path | 存放nginx进程的pid号 |
–lock-path | 共享存储器互斥锁文件路径 |
–http-client-body-temp-path | 客户端收到请求后,临时存放请求体目录 |
–http-proxy-temp-path | 使用代理后,通过该项设置存放请求体路径 |
–http-fastcgi-temp-path | 设置FastCGI临时文件的目录 |
–http-uwsgi-temp-path | 设置uWSGI临时文件的目录 |
–http-scgi-temp-path | 设置SCGI临时文件的目录 |
–user | 指定nginx运行的用户 |
–group | 指定nginx运行的用户组 |
–with-pcre | 设置PCRE库的源码路径 |
–with-http_v2_module | 用来支持 HTTP 2.0 的 |
–with-http_ssl_module | 如果需要对流量进行加密,可以使用该选项,再URLs中开始部分将会是https(需要OpenSSL库) |
–with-http_gzip_static_module | 启用gzip模块,在线实时压缩输出数据流 |