zenjia
This commit is contained in:
@@ -1,7 +1,24 @@
|
||||
map $msec $sample_200 {
|
||||
default 0;
|
||||
"~00$" 1; # 每 200 次大约打印 1 次
|
||||
}
|
||||
|
||||
map $http_user_agent $loggable {
|
||||
default 1;
|
||||
"clb-healthcheck" $sample_200;
|
||||
}
|
||||
|
||||
log_format custom_main '$remote_addr - $remote_user [$time_local+0800] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" rt=$request_time ua="$upstream_addr" '
|
||||
'us="$upstream_status" ut="$upstream_response_time"';
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
access_log /var/log/nginx/access.log custom_main if=$loggable;
|
||||
|
||||
# 前端静态文件
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
@@ -9,6 +26,7 @@ server {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
|
||||
# 精确匹配 index.html,禁用缓存
|
||||
location = /index.html {
|
||||
root /usr/share/nginx/html;
|
||||
Reference in New Issue
Block a user