Nginx目錄內容
在安裝完Nginx之后,可以到Nginx服務器安裝后的目錄里面查看資源列表。(下面舉例說明的是mac上通過brew安裝的Nginx目錄)
Jorys-MBP:1.12.0 jory$ cd /usr/local/Cellar/nginx/1.12.0/
Jorys-MBP:1.12.0 jory$ ls *
CHANGES README
INSTALL_RECEIPT.json homebrew.mxcl.nginx.plist
LICENSE
bin:
nginx
html:
50x.html index.html
share:
man
Jorys-MBP:nginx jory$ cd /usr/local/etc/nginx/
Jorys-MBP:nginx jory$ ls *
fastcgi.conf koi-win scgi_params
fastcgi.conf.default mime.types scgi_params.default
fastcgi_params mime.types.default uwsgi_params
fastcgi_params.default nginx.conf uwsgi_params.default
koi-utf nginx.conf.default win-utf
conf.d:
php-fpm
servers:
sites-available:
sites-enabled:
blog default
ssl:
Jorys-MBP:logs jory$ cd /usr/local/var/logs/
Jorys-MBP:logs jory$ ls *
access.log
nginx:
error.log
Nginx服務器的安裝目錄中主要包括了conf、html、logs和sbin等4個目錄。
1.conf目錄
conf目錄中存放了Nginx的所有配置文件。mac下使用brew安裝的Nginx配置文件目錄為/usr/local/etc/nginx。其中,nginx.conf文件是Nginx服務器的主配置文件,其他配置文件是用來配置Nginx的相關功能的,比如,配置fastcgi使用的fastcgi.conf和fastcgi_params兩個文件。在此目錄下,所有的配置文件都提供了以.default結尾的默認配置文件,方便我們將配置過的.conf文件恢復到初始狀態。
2.html目錄
html目錄中存放了Nginx服務器在運行過程中調用的一些html網頁文件。
- index.html文件。index.html是在瀏覽器頁面上打印出“Welcome to nginx!”這樣一句話。此文件是Nginx服務器運行成功后,默認調用的網頁。
- 50x.html實在瀏覽器頁面上打印出“The page you are looking for is temporarily unavailable.Please try again later.”Nginx在出現錯誤時會調用這個頁面。
另外可以在html目錄上自定義一些網頁文件,并在配置文件中配置發生什么情況時轉到相應的文件。
3.logs目錄
logs目錄用來存放Nginx服務器的日志。Nginx的日志功能強大,有不同的種類,可以自定義輸出格式內容。
4.sbin目錄
存放Nginx服務器的主程序。在brew安裝的nginx服務器中是bin目錄。