Nginx功能配置詳解

一、服務(wù)安裝與啟停:

windows:

nginx -s [ stop | quit | reopen | reload ]

start?nginx ?//啟動服務(wù)

nginx -s stop //停止服務(wù)

nginx -s reload //重裝配置文件

nginx -s reopen //打開日志

tasklist /fi "imagename eq nginx.exe" ?//顯示服務(wù)進(jìn)程

Linux:

cd nginx-1.2.0

./configure

make

sudo make install

ps aux|grep nginx //顯示服務(wù)進(jìn)程

在Linux下安裝Nginx詳細(xì)說明

為了確保能在Nginx中使用正則表達(dá)式進(jìn)行更靈活的配置,安裝之前需要確定系統(tǒng)是否安裝有 PCRE(Perl Compatible Regular Expressions)包。可以到ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/?下載最新的PCRE源碼包,使用下面命令下載編譯和安裝PCRE包:

# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.7.tar.gz?

# tar zxvf pcre-7.7.tar.gz # cd pcre-7.7 # ./configure?

# make?

# make install

接下來安裝Nginx,Nginx一般有兩個版本,分別是穩(wěn)定版和開發(fā)版,可以根據(jù)您的目的來選擇這兩個版本的其中一個,下面是把 Nginx 安裝到 /opt/nginx 目錄下的詳細(xì)步驟:

# wget http://sysoev.ru/nginx/nginx-0.6.31.tar.gz

# tar zxvf nginx-0.6.31.tar.gz # cd nginx-0.6.31

# ./configure --with-http_stub_status_module –prefix=/opt/nginx

# make # make install

其中參數(shù)--with-http_stub_status_module是為了啟用nginx的NginxStatus功能,用來監(jiān)控Nginx的當(dāng)前狀態(tài)。

? ? 安裝成功后/opt/nginx目錄下有四個子目錄分別是:conf、html、logs、sbin 。其中Nginx的配置文件存放于conf/nginx.conf,Nginx只有一個程序文件位于sbin目錄下的nginx文件。確保系統(tǒng)的80端口沒被其他程序占用,運行sbin/nginx命令來啟動Nginx,打開瀏覽器訪問此機(jī)器的IP,如果瀏覽器出現(xiàn)Welcome to nginx! 則表示Nginx已經(jīng)安裝并運行成功。

二、常用的Nginx參數(shù)和控制

Nginx安裝后只有一個程序文件,本身并不提供各種管理程序,它是使用參數(shù)和系統(tǒng)信號機(jī)制對 Nginx進(jìn)程本身進(jìn)行控制的。?

通過程序運行參數(shù)控制:

Nginx的參數(shù)包括有如下幾個:

-c?<path_to_config>:使用指定的配置文件而不是conf目錄下的nginx.conf 。

-t:測試配置文件是否正確,在運行時需要重新加載配置的時候,此命令非常重要,用來檢測所修改的配置文件是否有語法錯誤。

-v:顯示nginx版本號。

-V:顯示nginx的版本號以及編譯環(huán)境信息以及編譯時的參數(shù)。

例如我們要測試某個配置文件是否書寫正確,可以使用以下命令:

sbin/nginx -t -c? conf/nginx2.conf

通過信號對Nginx進(jìn)行控制:

Nginx 支持下表中的信號:

信號名????????????????作用描述

TERM, INT? ? ? ? ?快速關(guān)閉程序,中止當(dāng)前正在處理的請求

QUIT? ? ? ? ? ? ? ? ? ?處理完當(dāng)前請求后,關(guān)閉程序

HUP????????????????????重新加載配置,并開啟新的工作進(jìn)程,關(guān)閉就的進(jìn)程,此操作不會中斷請求

USR1? ? ? ? ? ? ? ? ? 重新打開日志文件,用于切換日志,例如每天生成一個新的日志文件

USR2? ? ? ? ? ? ? ? ? 平滑升級可執(zhí)行程序

WINCH????????????????從容關(guān)閉工作進(jìn)程

有兩種方式來通過這些信號去控制Nginx:

第一是通過logs目錄下的nginx.pid查看當(dāng)前運行的Nginx的進(jìn)程ID,通過kill -XXX <pid>來控制Nginx,其中XXX就是上表中列出的信號名。

如果系統(tǒng)中只有一個Nginx進(jìn)程,那您也可以通過killall命令來完成,例如運行killall -s HUP nginx來讓Nginx重新加載配置。

三、配置Nginx

先來看一個實際的配置文件:

user nobody;

# 工作進(jìn)程的屬主?

worker_processes 4;

# 工作進(jìn)程數(shù),一般與 CPU 核數(shù)等同?

#error_log logs/error.log;?

#error_log logs/error.log notice;?

#error_log logs/error.log info;?

#pid logs/nginx.pid;

events {?

? ? use epoll;#Linux 下性能最好的event模式?

? ? worker_connections 2048;# 每個工作進(jìn)程允許最大的同時連接數(shù)?

}?

http {?

? ? include mime.types;?

? ? default_type application/octet-stream;?

? ? #log_format main \''$remote_addr - $remote_user [$time_local] $request \''?

? ? # \''"$status" $body_bytes_sent "$http_referer" \''?

? ? # \''"$http_user_agent" "$http_x_forwarded_for"\'';?

? ? #access_log off;?

? ? access_log logs/access.log;# 日志文件名?

? ? sendfile on;?

? ? #tcp_nopush on;?

? ? tcp_nodelay on;?

? ? keepalive_timeout 65;?

? ? include gzip.conf; # 集群中的所有后臺服務(wù)器的配置信息?

? ? upstream tomcats {?

? ? ? ? server 192.168.0.11:8080 weight=10;?

? ? ? ? server 192.168.0.11:8081 weight=10;?

? ? ? ? server 192.168.0.12:8080 weight=10;?

? ? ? ? server 192.168.0.12:8081 weight=10;?

? ? ? ? server 192.168.0.13:8080 weight=10;?

? ? ? ? server 192.168.0.13:8081 weight=10;?

? ? }?

? ? server {?

? ? ? ? listen 80;#HTTP 的端口?

? ? ? ? server_name localhost;?

? ? ? ? charset utf-8;?

? ? ? ? #access_log logs/host.access.log main;?

? ? ? ? location ~ ^/NginxStatus/ {?

? ? ? ? ? ? stub_status on; #Nginx 狀態(tài)監(jiān)控配置?

? ? ? ? ? ? access_log off;?

? ? ? ? }?

? ? ? ? location ~ ^/(WEB-INF)/ {?deny all;?}?

? ? ? ? location ~ \\.(htm|html|asp|php|gif|jpg|jpeg|png|bmp|ico|rar|css|js| zip|java|jar|txt|flv|swf|mid|doc|ppt|xls|pdf|txt|mp3|wma)$ {?

? ? ? ? ? ? root /opt/webapp;?

? ? ? ? ? ? expires 24h;?

? ? ? ? }?

? ? ? ? location / {?

? ? ? ? ? ? proxy_pass http://tomcats;# 反向代理?

? ? ? ? ? ? include proxy.conf;?

? ? ? ? }?

? ? ? ? error_page 404 /html/404.html;?

? ? ? ? # redirect server error pages to the static page /50x.html?

? ? ? ? # error_page 502 503 /html/502.html;?

? ? ? ? error_page 500 504 /50x.html;?

? ? ? ? location = /50x.html {?root html;?}?

? ? }?

}

Nginx監(jiān)控:

上述配置中,首先我們定義了一個location ~ ^/NginxStatus/,這樣通過http://localhost/NginxStatus/ 就可以監(jiān)控到 Nginx 的運行信息,顯示的內(nèi)容如下:

Active connections: 70 server accepts handled requests 14553819 14553819 19239266 Reading: 0 Writing: 3 Waiting: 67

NginxStatus顯示的內(nèi)容意思如下:

????active connections? – 當(dāng)前 Nginx 正處理的活動連接數(shù)。

????server accepts handled requests -- 總共處理了 14553819 個連接 , 成功創(chuàng)建 14553819 次握手 ( 證明中間沒有失敗的 ), 總共處理了 19239266 個請求 ( 平均每次握手處理了 1.3 個數(shù)據(jù)請求 )。

????reading -- nginx 讀取到客戶端的 Header 信息數(shù)。

????writing -- nginx 返回給客戶端的 Header 信息數(shù)。

????waiting -- 開啟 keep-alive 的情況下,這個值等于 active - (reading + writing),意思就是 Nginx已經(jīng)處理完正在等候下一次請求指令的駐留連接。

靜態(tài)文件處理:

通過正則表達(dá)式,我們可讓Nginx識別出各種靜態(tài)文件,例如images路徑下的所有請求可以寫為:

location ~ ^/images/? { root /opt/webapp/images; }

而下面的配置則定義了幾種文件類型的請求處理方式。

location ~ \\.(htm|html|gif|jpg|jpeg|png|bmp|ico|css|js|txt)$ {?

? ? root /opt/webapp;?

? ? expires? 24h;?

}

對于例如圖片、靜態(tài)HTML文件、js腳本文件和css樣式文件等,我們希望Nginx直接處理并返回給瀏覽器,這樣可以大大加快網(wǎng)頁瀏覽時的速度。因此對于這類文件我們需要通過root指令來指定文件的存放路徑,同時因為這類文件并不常修改,通過expires指令來控制其在瀏覽器的緩存,以減少不必要的請求。expires指令可以控制HTTP應(yīng)答中的“Expires”和“Cache-Control”的頭標(biāo)(起到控制頁面緩存的作用)。可以使用以下的格式來書寫Expires:

expires 1 January, 1970, 00:00:01 GMT; expires 60s; expires 30m; expires 24h; expires 1d; expires max; expires off;

動態(tài)頁面請求處理:

? ? Nginx本身并不支持現(xiàn)在流行的JSP、ASP、PHP、PERL等動態(tài)頁面,但它可以通過反向代理將請求發(fā)送到后端的服務(wù)器,例如Tomcat、Apache、IIS等來完成動態(tài)頁面的請求處理。前面的配置示例中,我們首先定義了由Nginx直接處理的一些靜態(tài)文件請求后,其他所有的請求通過 proxy_pass 指令傳送給后端的服務(wù)器。最簡單的?proxy_pass?用法如下:

location / {

? ? proxy_pass? ? http://localhost:8080;

? ? proxy_set_header X-Real-IP $remote_addr;

}

這里沒有使用到集群,而是將請求直接送到運行在8080端口的Tomcat服務(wù)上來完成類似JSP和Servlet的請求處理。

當(dāng)頁面的訪問量非常大的時候,往往需要多個應(yīng)用服務(wù)器來共同承擔(dān)動態(tài)頁面的執(zhí)行操作,這時我們就需要使用集群的架構(gòu)。Nginx通過upstream指令來定義一個服務(wù)器的集群,最前面那個完整的例子中我們定義了一個名為tomcats的集群,這個集群中包括了三臺服務(wù)器共6個Tomcat 服務(wù)。而proxy_pass指令的寫法變成了:

location? / {

????proxy_pass? http://tomcats;

? ? proxy_set_header X-Real-IP? $remote_addr;

}

在Nginx的集群配置中,Nginx使用最簡單的平均分配規(guī)則給集群中的每個節(jié)點分配請求。一旦某個節(jié)點失效時,或者重新起效時,Nginx都會非常及時的處理狀態(tài)的變化,以保證不會影響到用戶的訪問。

四、常用命令說明

1、Location

Location 指令,是用來為匹配的 URI 進(jìn)行配置,URI 即語法中的"/uri/",可以是字符串或正則表達(dá)式。但如果要使用正則表達(dá)式,則必須指定前綴。

1)基本語法

location ?[=|~|~*|^~|@] ?/uri/ ?{...}

= ? ? 表示精確匹配,如果找到,立即停止搜索并立即處理此請求。

~ ? ? 表示區(qū)分大小寫匹配

~* ? 表示不區(qū)分大小寫匹配

^~ ?表示只匹配字符串,不查詢正則表達(dá)式。

@ ? ?指定一個命名的location,一般只用于內(nèi)部重定向請求。

2)匹配過程

首先對字符串進(jìn)行匹配查詢,最確切的匹配將被使用。然后,正則表達(dá)式的匹配查詢開始,匹配第一個結(jié)果后會停止搜索,如果沒有找到正則表達(dá)式,將使用字符串的搜索結(jié)果,如果字符串和正則都匹配,那么正則優(yōu)先級較高。

3)配置實例

location = / {

? ? ????#只匹配對 / 目錄的查詢

? ????? [ config ?A ] ?

}

location ? ?/ ?{

? ? ? ??# 匹配以 / 開始的查詢,即所有查詢都匹配。

? ? ? ??[ config ?B ]?

}

location ?^~ /images/ {

? ? ? ??# 匹配以 /images/ 開始的查詢,不再檢查正則表達(dá)式。

? ????? [ config ?C ]?

}

location ~* \.(gif|jpg|jpeg)$ ?{

????????# 匹配以gif, jpg, or jpeg結(jié)尾的文件,但優(yōu)先級低于config C。

????????[ config ?D ]?

}

4)全局變量

$args ? ? ? ? ? ? ? ? ? ? ? ? #這個變量等于請求行中的參數(shù)。

$content_length ? ? ? #請求頭中的Content-length字段。

$content_type ? ? ? ? ? #請求頭中的Content-Type字段。

$document_root ? ? ? #當(dāng)前請求在root指令中指定的值。

$host ? ? ? ? ? ? ? ? ? ? ? ? #請求主機(jī)頭字段,否則為服務(wù)器名稱。

$http_user_agent ? ? ?#客戶端agent信息。

$http_cookie ? ? ? ? ? ? #客戶端cookie信息。

$limit_rate ? ? ? ? ? ? ? ? #這個變量可以限制連接速率。

$request_body_file ? #客戶端請求主體信息的臨時文件名。

$request_mothod ? ? #客戶端請求的動作,通常為GET或POST。

$remote_addr ? ? ? ? ? #客戶端的IP地址。

$remote_port ? ? ? ? ? ?#客戶端的端口。

$remote_user ? ? ? ? ? ?#已經(jīng)經(jīng)過Auth Basic Module驗證的用戶名。

$request_filename ? ?#當(dāng)前請求的文件路徑,由root或alias指令與URI請求生成。

$query_string ? ? ? ? ? ?#與$args相同。

$scheme ? ? ? ? ? ? ? ? ? ?#HTTP方法(如http,https)。

$server_protocol ? ? ? #請求使用的協(xié)議,通常是HTTP/1.0或HTTP/1.1。

$server_addr ? ? ? ? ? ? #服務(wù)器地址,在完成一次系統(tǒng)調(diào)用后可以確定這個值。

$server_name ? ? ? ? ? #服務(wù)器名稱。

$server_port ? ? ? ? ? ? #請求到達(dá)服務(wù)器的端口號。

$request_uri ? ? ? ? ? ? #包含請求參數(shù)的原始URI,不包含主機(jī)名,如“/foo/bar.php?arg=baz”。

$uri ? ? ? ? ? ? ? ? ? ? ? ? ? #不帶請求參數(shù)的當(dāng)前URI,不包含主機(jī)名,如“/foo/var.html”。

$document_uri ? ? ? ?#與$uri相同。

2、upstream(負(fù)載均衡)

把www.domain.com均衡到本機(jī)不同的端口,也可以改為均衡到不同的地址上。

http ?{

? ? upstream myproject {

? ? ? ? server ?127.0.0.1:8000 ? weight=3;

? ? ? ? server ?127.0.0.1:8001;

? ? ? ??server ?127.0.0.1:8002;

? ? ? ? server ?127.0.0.1:8003;

? ? }

? ? server {

? ? ? ? listen 80;

? ? ? ? server_name ?www.domain.com;

? ? ? ? location / {

? ? ? ? ? ? proxy_pass ?http://myproject;

? ? ? ? }

? ? }

}

nginx的upstream目前支持以下幾種方式的分配:

1)輪詢(默認(rèn)):每個請求按時間順序逐一分配到不同的后端服務(wù)器,如果后端服務(wù)器down掉,能自動剔除。

2)weight:指定輪詢幾率,weight和訪問比率成正比,用于后端服務(wù)器性能不均的情況。好的服務(wù)器weight高些,差的服務(wù)器weight低些。

upstream ?bakend {

? ? server ?127.0.0.1:8000 ? weight=3;

}

3)ip_hash:每個請求按訪問的IP和hash結(jié)果分配,這樣每個訪客固定訪問一個后端服務(wù)器,可以解決session的問題。無法將權(quán)重(weight)與ip_hash聯(lián)合起來分發(fā)連接。如果有某臺服務(wù)器不可用,必須標(biāo)記其為down。

upstream ?bakend {

? ? ip_hash;

? ? server ? 192.168.0.14:80;

? ? server ? 192.168.0.15:80;?

}

4)fair(第三方):按后端服務(wù)器的響應(yīng)時間來分配請求,響應(yīng)時間短的優(yōu)先分配。

upstream ?bakend ?{

? ? server ?server1;

? ? server ?server2;

? ? fair;

}

5)url_hash(第三方):

upstream ?bakend {

? ? ip_hash;

? ? server ?127.0.0.1:8000 ? down;

? ??server ?127.0.0.1:8001 ? weight=2;

? ? server ?127.0.0.1:8002;

? ? server ?127.0.0.1:8003 ? backup;

}

在需要使用負(fù)載均衡的server中增加proxy_pass http://bakend/;

每個設(shè)備的狀態(tài)設(shè)置為:

1>down:表示當(dāng)前的server暫時不參與負(fù)載。

2>weight:權(quán)重默認(rèn)為1,weight越大,負(fù)載的權(quán)重就越大。

3>max_fails:允許請求失敗的次數(shù)默認(rèn)為1,當(dāng)超過最大次數(shù)時,返回proxy_next_upstream模塊定義的錯誤。

4>fail_timeout:max_fails次失敗后,暫停的時間。

5>backup:備用,其他所有的非backup機(jī)器down或者忙的時候,請求backup機(jī)器。所以這臺機(jī)器壓力會最輕。

五、編譯優(yōu)化

默認(rèn)nginx使用的GCC編譯參數(shù)是-O,需要更加優(yōu)化可以使用以下兩個參數(shù):

–with-cc-opt='-O3′?

–with-cpu-opt=opteron?

使得編譯針對特定CPU以及增加GCC的優(yōu)化;

六、configure參數(shù)詳解

源代碼解壓后即可輸入./configure –help 查看所有configure參數(shù);

具體參數(shù)解釋如下:

–prefix=<path> – Nginx安裝路徑。如果沒有指定,默認(rèn)為 /usr/local/nginx。?

–sbin-path=<path> – Nginx可執(zhí)行文件安裝路徑。只能安裝時指定,如果沒有指定,默認(rèn)為<prefix>/sbin/nginx。?

–conf-path=<path> – 在沒有給定-c選項下默認(rèn)的nginx.conf的路徑。如果沒有指定,默認(rèn)為<prefix>/conf/nginx.conf。?

–pid-path=<path> – 在nginx.conf中沒有指定pid指令的情況下,默認(rèn)的nginx.pid的路徑。如果沒有指定,默認(rèn)為 <prefix>/logs/nginx.pid。?

–lock-path=<path> – nginx.lock文件的路徑。?

–error-log-path=<path> – 在nginx.conf中沒有指定error_log指令的情況下,默認(rèn)的錯誤日志的路徑。如果沒有指定,默認(rèn)為 <prefix>/logs/error.log。?

–http-log-path=<path> – 在nginx.conf中沒有指定access_log指令的情況下,默認(rèn)的訪問日志的路徑。如果沒有指定,默認(rèn)為 <prefix>/logs/access.log。?

–user=<user> – 在nginx.conf中沒有指定user指令的情況下,默認(rèn)的nginx使用的用戶。如果沒有指定,默認(rèn)為 nobody。?

–group=<group> – 在nginx.conf中沒有指定user指令的情況下,默認(rèn)的nginx使用的組。如果沒有指定,默認(rèn)為 nobody。?

–builddir=DIR – 指定編譯的目錄?

–with-rtsig_module – 啟用 rtsig 模塊?

–with-select_module –without-select_module – 允許或不允許開啟SELECT模式,如果 configure 沒有找到更合適的模式,比如:kqueue(sun os),epoll (linux kenel 2.6+), rtsig(實時信號)或者/dev/poll(一種類似select的模式,底層實現(xiàn)與SELECT基本相 同,都是采用輪訓(xùn)方法) SELECT模式將是默認(rèn)安裝模式?

–with-poll_module –without-poll_module – Whether or not to enable the poll module. This module is enabled by default if a more suitable method such as kqueue, epoll, rtsig or /dev/poll is not discovered by configure.?

–with-http_ssl_module – 開啟HTTP SSL模塊,使NGINX可以支持HTTPS請求。這個模塊需要已經(jīng)安裝了OPENSSL,在DEBIAN上是libssl?

–with-http_realip_module – 啟用 ngx_http_realip_module?

–with-http_addition_module – 啟用 ngx_http_addition_module?

–with-http_sub_module – 啟用 ngx_http_sub_module?

–with-http_dav_module – 啟用 ngx_http_dav_module?

–with-http_flv_module – 啟用 ngx_http_flv_module?

–with-http_stub_status_module – 啟用 “server status” 頁?

–without-http_charset_module – 禁用 ngx_http_charset_module?

–without-http_gzip_module – 禁用 ngx_http_gzip_module. 如果啟用,需要 zlib 。?

–without-http_ssi_module – 禁用 ngx_http_ssi_module?

–without-http_userid_module – 禁用 ngx_http_userid_module?

–without-http_access_module – 禁用 ngx_http_access_module?

–without-http_auth_basic_module – 禁用 ngx_http_auth_basic_module?

–without-http_autoindex_module – 禁用 ngx_http_autoindex_module?

–without-http_geo_module – 禁用 ngx_http_geo_module?

–without-http_map_module – 禁用 ngx_http_map_module?

–without-http_referer_module – 禁用 ngx_http_referer_module?

–without-http_rewrite_module – 禁用 ngx_http_rewrite_module. 如果啟用需要 PCRE 。?

–without-http_proxy_module – 禁用 ngx_http_proxy_module?

–without-http_fastcgi_module – 禁用 ngx_http_fastcgi_module?

–without-http_memcached_module – 禁用 ngx_http_memcached_module?

–without-http_limit_zone_module – 禁用 ngx_http_limit_zone_module?

–without-http_empty_gif_module – 禁用 ngx_http_empty_gif_module?

–without-http_browser_module – 禁用 ngx_http_browser_module?

–without-http_upstream_ip_hash_module – 禁用 ngx_http_upstream_ip_hash_module?

–with-http_perl_module – 啟用 ngx_http_perl_module?

–with-perl_modules_path=PATH – 指定 perl 模塊的路徑?

–with-perl=PATH – 指定 perl 執(zhí)行文件的路徑?

–http-log-path=PATH – Set path to the http access log?

–http-client-body-temp-path=PATH – Set path to the http client request body temporary files?

–http-proxy-temp-path=PATH – Set path to the http proxy temporary files?

–http-fastcgi-temp-path=PATH – Set path to the http fastcgi temporary files?

–without-http – 禁用 HTTP server?

–with-mail – 啟用 IMAP4/POP3/SMTP 代理模塊?

–with-mail_ssl_module – 啟用 ngx_mail_ssl_module?

–with-cc=PATH – 指定 C 編譯器的路徑?

–with-cpp=PATH – 指定 C 預(yù)處理器的路徑?

–with-cc-opt=OPTIONS – Additional parameters which will be added to the variable CFLAGS. With the use of the system library PCRE in FreeBSD, it is necessary to indicate –with-cc-opt=”-I /usr/local/include”. If we are using select() and it is necessary to increase the number of file descriptors, then this also can be assigned here: –with-cc-opt=”-D FD_SETSIZE=2048″.?

–with-ld-opt=OPTIONS – Additional parameters passed to the linker. With the use of the system library PCRE in FreeBSD, it is necessary to indicate –with-ld-opt=”-L /usr/local/lib”.?

–with-cpu-opt=CPU – 為特定的 CPU 編譯,有效的值包括:pentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, ppc64?

–without-pcre – 禁止 PCRE 庫的使用。同時也會禁止 HTTP rewrite 模塊。在 “l(fā)ocation” 配置指令中的正則表達(dá)式也需要 PCRE 。?

–with-pcre=DIR – 指定 PCRE 庫的源代碼的路徑。?

–with-pcre-opt=OPTIONS – Set additional options for PCRE building.?

–with-md5=DIR – Set path to md5 library sources.?

–with-md5-opt=OPTIONS – Set additional options for md5 building.?

–with-md5-asm – Use md5 assembler sources.?

–with-sha1=DIR – Set path to sha1 library sources.?

–with-sha1-opt=OPTIONS – Set additional options for sha1 building.?

–with-sha1-asm – Use sha1 assembler sources.?

–with-zlib=DIR – Set path to zlib library sources.?

–with-zlib-opt=OPTIONS – Set additional options for zlib building.?

–with-zlib-asm=CPU – Use zlib assembler sources optimized for specified CPU, valid values are: pentium, pentiumpro?

–with-openssl=DIR – Set path to OpenSSL library sources?

–with-openssl-opt=OPTIONS – Set additional options for OpenSSL building?

–with-debug – 啟用調(diào)試日志?

–add-module=PATH – Add in a third-party module found in directory PATH?

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

推薦閱讀更多精彩內(nèi)容

  • 編譯自:installing-nginx-open-source 目錄 選擇 Stable 還是 Mainline...
    C86guli閱讀 3,877評論 0 21
  • nginx 編譯參數(shù)詳解 標(biāo)題是不是很欠揍,個人認(rèn)為確實值得一看,如果你不了解nginx,或者你剛學(xué)nginx,或...
    可不可以_78b2閱讀 240評論 0 0
  • 1.什么是負(fù)載均衡?通過某種負(fù)載分擔(dān)技術(shù),將外部發(fā)送來的請求按照某種策略分配到服務(wù)器集合的某一臺服務(wù)器上,而接收到...
    少艾_91df閱讀 531評論 0 0
  • NGINX安裝配置 @(nginx筆記)[nginx] 創(chuàng)建專用組和用戶 環(huán)境安裝準(zhǔn)備 沒有的話就安裝pcre h...
    ahhhhhhhh閱讀 1,046評論 0 2
  • 今天下午去接孩子,看到大凱時,他哭喪著個臉,結(jié)果劉老師告訴我,他是咬手指甲蓋,結(jié)果指甲蓋掉到口腔里去了,...
    凱然寶貝閱讀 201評論 0 0