欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

nginx配置文件祥解

nginx配置說明----------------------------

創(chuàng)新互聯公司堅持“要么做到,要么別承諾”的工作理念,服務領域包括:成都網站建設、成都網站設計、企業(yè)官網、英文網站、手機端網站、網站推廣等服務,滿足客戶于互聯網時代的安康網站設計、移動媒體設計的需求,幫助企業(yè)找到有效的互聯網解決方案。努力成為您成熟可靠的網絡建設合作伙伴!

#運行用戶
usernobody nobody;
#啟動進程
worker_processes2;
#全局錯誤日志及PID文件
error_loglogs/error.log notice;
pidlogs/nginx.pid;
#工作模式及連接數上限
events {
use epoll;
worker_connections1024;
}
#設定http服務器,利用它的反向代理功能提供負載均衡支持
http {
#設定mime類型
includeconf/mime.types;
default_typeapplication/octet-stream;
#設定日志格式
log_format main\'$remote_addr - $remote_user [$time_local] \'
\'"$request" $status $bytes_sent \'
\'"$http_referer" "$http_user_agent" \'
\'"$gzip_ratio"\';
log_format download \'$remote_addr - $remote_user [$time_local] \'
\'"$request" $status $bytes_sent \'
\'"$http_referer" "$http_user_agent" \'
\'"$http_range" "$sent_http_content_range"\';
#設定請求緩沖
client_header_buffer_size1k;
large_client_header_buffers4 4k;
#開啟gzip模塊
gzip on;
gzip_min_length1100;
gzip_buffers4 8k;
gzip_typestext/plain;
output_buffers1 32k;
postpone_output1460;
#設定access log
access_loglogs/access.logmain;
client_header_timeout3m;
client_body_timeout3m;
send_timeout3m;
sendfileon;
tcp_nopushon;
tcp_nodelayon;
keepalive_timeout65;
#設定負載均衡的服務器列表
upstream mysvr {
#weigth參數表示權值,權值越高被分配到的幾率越大
#本機上的Squid開啟3128端口
server 192.168.8.1:3128 weight=5;
server 192.168.8.2:80weight=1;
server 192.168.8.3:80weight=6;
}
#設定虛擬主機
server {
listen80;
server_name192.168.8.1 www.yejr.com;
charset gb2312;
#設定本虛擬主機的訪問日志
access_loglogs/www.yejr.com.access.logmain;
#如果訪問 /img/*, /js/*, /css/* 資源,則直接取本地文件,不通過squid
#如果這些文件較多,不推薦這種方式,因為通過squid的緩存效果更好
location ~ ^/(img|js|css)/{
root/data3/Html;
expires 24h;
}
#對 "/" 啟用負載均衡
location / {
proxy_passhttp://mysvr;
proxy_redirectoff;
proxy_set_headerHost $host;
proxy_set_headerX-Real-IP $remote_addr;
proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size10m;
client_body_buffer_size 128k;
proxy_connect_timeout90;
proxy_send_timeout90;
proxy_read_timeout90;
proxy_buffer_size4k;
proxy_buffers4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
#設定查看Nginx狀態(tài)的地址
location /NginxStatus {
stub_statuson;
access_logon;
auth_basic"NginxStatus";
auth_basic_user_fileconf/htpasswd;
}
}
}
備注:conf/htpasswd 文件的內容用 apache 提供的 htpasswd 工具來產生即可,內容大致如下:
3.) 查看 Nginx 運行狀態(tài)
輸入地址 http://192.168.8.1/NginxStatus/,輸入驗證帳號密碼,即可看到類似如下內容:
Active connections: 328
server accepts handled requests
9309898228890
Reading: 1 Writing: 3 Waiting: 324

第一行表示目前活躍的連接數
第三行的第三個數字表示Nginx運行到當前時間接受到的總請求數,如果快達到了上限,就需要加大上限值了。
第四行是Nginx的隊列狀態(tài)

當前標題:nginx配置文件祥解
網站路徑:http://chinadenli.net/article18/cgpodp.html

成都網站建設公司_創(chuàng)新互聯,為您提供網站排名手機網站建設響應式網站云服務器關鍵詞優(yōu)化虛擬主機

廣告

聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯

成都做網站