SHOW:
|
|
- or go back to the newest paste.
1 | ############################################# | |
2 | # 這是 Nginx 服務的主要設定檔 | |
3 | # 檔案位置預設為 /usr/local/etc/nginx/nginx.conf | |
4 | ############################################# | |
5 | ||
6 | # 啟用程序的 Linux 帳戶 | |
7 | user nginx; | |
8 | ||
9 | # 啟用的執行緒數量(建議為你的 CPU 核心數 x 2) | |
10 | worker_processes 2; | |
11 | ||
12 | # Error Log 檔的位置 | |
13 | error_log logs/error.log; | |
14 | error_log logs/error.log notice; | |
15 | error_log logs/error.log info; | |
16 | ||
17 | pid logs/nginx.pid; | |
18 | ||
19 | events { | |
20 | # 允許同一時間連線總數量 | |
21 | worker_connections 1024; | |
22 | } | |
23 | ||
24 | http { | |
25 | include mime.types; | |
26 | default_type application/octet-stream; | |
27 | ||
28 | # 預設的 log 記錄格式 | |
29 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
30 | '$status $body_bytes_sent "$http_referer" ' | |
31 | '"$http_user_agent" "$http_x_forwarded_for"'; | |
32 | ||
33 | # Access log 檔的位置 | |
34 | access_log logs/access.log main; | |
35 | ||
36 | sendfile on; | |
37 | #tcp_nopush on; | |
38 | ||
39 | #keepalive_timeout 0; | |
40 | keepalive_timeout 65; | |
41 | ||
42 | # 預設不會自動啟動 gzip 壓縮 | |
43 | #gzip on; | |
44 | ||
45 | ** # 載入 /etc/nginx/conf.d/ 下的所有設定檔 | |
46 | ** # 通常都是各個虛擬主機的配置 | |
47 | ** include /etc/nginx/conf.d/*.conf; | |
48 | } |