這篇文章將為大家詳細(xì)講解有關(guān)LNMP架構(gòu)中Nginx服務(wù)配置文件的示例分析,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價比建陽網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式建陽網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋建陽地區(qū)。費(fèi)用合理售后完善,10多年實體公司更值得信賴。
nginx的配置文件比較簡單,但功能相當(dāng)強(qiáng)大,可以自由靈活的進(jìn)行相關(guān)配置,因此,還是了解下其配置文件的一此信息
1、Nginx服務(wù)目錄結(jié)構(gòu)介紹
安裝完成后,在安裝路徑下就會有Nginx目錄信息
[root@centos6 application]# tree nginx
nginx
+-- client_body_temp
+-- conf #nginx服務(wù)配置文件目錄
| +-- fastcgi.conf #fastcgi配置文件
| +-- fastcgi.conf.default
| +-- fastcgi_params #fastcgi參數(shù)配置文件
| +-- fastcgi_params.default
| +-- koi-utf
| +-- koi-win
| +-- mime.types
| +-- mime.types.default
| +-- nginx.conf #nginx服務(wù)的主配置文件
| +-- nginx.conf.default #nginx服務(wù)的默認(rèn)配置文件
| +-- scgi_params
| +-- scgi_params.default
| +-- uwsgi_params
| +-- uwsgi_params.default
| +-- win-utf
+-- fastcgi_temp
+-- html #編譯安裝nginx默認(rèn)的首頁配置文件目錄
| +-- 50x.html #錯誤頁面配置文件
| +-- index.html #默認(rèn)的首頁配置文件
| +-- index.html.bak
+-- logs #日志配置文件目錄
| +-- access.log #訪問日志文件
| +-- error.log #錯誤日志文件
+-- proxy_temp
+-- sbin #命令目錄
| +-- nginx #Nginx服務(wù)啟動命令
+-- scgi_temp #臨時目錄
+-- uwsgi_temp
2、Nginx服務(wù)主配置文件介紹
[root@centos6 conf]# egrep -v "#|^$" nginx.conf
worker_processes 1; #工作進(jìn)程數(shù)
events { #事件
worker_connections 1024; #并發(fā)數(shù),單位時間內(nèi)最大連接數(shù)
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server { #虛擬主機(jī)標(biāo)簽
listen 80; #監(jiān)聽的端口號
server_name localhost; #服務(wù)器主機(jī)名
location / {
root html; #默認(rèn)站點目錄
index index.html index.htm; #默認(rèn)首頁文件
}
error_page 500 502 503 504 /50x.html; #錯誤頁面文件
location = /50x.html {
root html;
}
}
}
3、Nginx服務(wù)幫助信息
[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編譯參數(shù)查看
[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
實際生產(chǎn)環(huán)境比較實用的查看參數(shù),比如服務(wù)非你自己所安裝,但又沒有相關(guān)文檔參考,此參數(shù)可以提供一些相關(guān)的信息
關(guān)于“LNMP架構(gòu)中Nginx服務(wù)配置文件的示例分析”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,使各位可以學(xué)到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。
名稱欄目:LNMP架構(gòu)中Nginx服務(wù)配置文件的示例分析
網(wǎng)站地址:http://aaarwkj.com/article2/gpieic.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供標(biāo)簽優(yōu)化、手機(jī)網(wǎng)站建設(shè)、用戶體驗、網(wǎng)站營銷、電子商務(wù)、商城網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)