Browse Source

小调整

zjcqoo 6 years ago
parent
commit
4485058425
3 changed files with 36 additions and 17 deletions
  1. 1 1
      docs/blogs/js-hook.md
  2. 34 15
      log.conf
  3. 1 1
      www.conf

+ 1 - 1
docs/blogs/js-hook.md

@@ -223,7 +223,7 @@ self['lo' + 'cat' + 'ion']    // location object
 this[atob('bG9jYXRpb24=')]    // location object
 ```
 
-更别提 `eval` 这些了。所以,如果网页有意访问 `location`,我们是无法拦截的!
+更别提 `eval` 这些了。所以,如果网页有意访问 `location`,我们是无法拦截的!
 
 这个特征,可以给 Web 开发者一个警示:如果想检测当前页面 URL 是否合法,尽量不要出现明文的 `window`、`location` 等关键字,而是通过动态的方式访问,以防落入上述这种陷阱。如果想检测你的网站是否安全,可尝试用演示站点访问你的登录页,如果没有跳转到原始网站,说明你的 `location` 接口用得不够安全,用户极有可能在代理页面中输入账号密码,导致隐私泄露!
 

+ 34 - 15
log.conf

@@ -5,39 +5,58 @@
 # 分隔: tab (\t)
 # 前缀: 格式版本。格式变化时递增,方便解析
 # 备注:
-# origin_id
+# _origin_id
 #   请求源的别名,参考 allowed-sites.conf
-# ver
+# _ver
 #   前端配置的版本,定义于 www/conf.js
 # remote_addr
 #   用户 IP,目前未考虑 XFF
-# level
+# _level
 #   实验中。记录切换状态(首次请求为 1。切换失败再次请求为 0,表示不接受切换)
-# switched
+# _switched
 #   实验中。记录是否切换到廉价节点(未切换则为空,有切换则记录资源体积大小)
-# bodyhash
+# _bodyhash
 #   返回内容的 SHA256,用于统计重复内容
 # upstream_http_access_control_allow_origin
 #   统计 acao = * 的站点,用于加入可直连列表
-# ref
+# _ref
 #   请求 referer,不包括 `https://example.com/-----` 部分
-# mode
+# _mode
 #   前端 request.mode 属性
-# type
+# _type
 #   前端 request.destination 属性
 #
 log_format              log_proxy escape=none
   '02	'
-  '$time_iso8601	$_origin_id	$_ver	$remote_addr	'
-  '$_level	$_switched	$upstream_cache_status	$request_time	'
-  '$request_length	$bytes_sent	'
-  '$request_method	$_url	$status	$_bodyhash	$upstream_http_access_control_allow_origin	'
-  '$http_user_agent	$_ref	$_mode	$_type'
+  '$time_iso8601	'
+  '$_origin_id	'
+  '$_ver	'
+  '$remote_addr	'
+  '$_level	'
+  '$_switched	'
+  '$upstream_cache_status	'
+  '$request_time	'
+  '$request_length	'
+  '$bytes_sent	'
+  '$request_method	'
+  '$_url	'
+  '$status	'
+  '$_bodyhash	'
+  '$upstream_http_access_control_allow_origin	'
+  '$http_user_agent	'
+  '$_ref	'
+  '$_mode	'
+  '$_type'
 ;
 
 log_format              log_www escape=none
   '01	'
-  '$time_iso8601	$remote_addr	$request_time	'
-  '$request_method	$uri	$http_host	$status	'
+  '$time_iso8601	'
+  '$remote_addr	'
+  '$request_time	'
+  '$request_method	'
+  '$uri	'
+  '$http_host	'
+  '$status	'
   '$http_user_agent'
 ;

+ 1 - 1
www.conf

@@ -5,7 +5,7 @@ include               mime.types;
 sendfile              on;
 charset               utf-8;
 
-# 安装步骤多,节省的流量不多,暂时不开
+# 安装步骤多,节省的流量不多,暂时不开
 # brotli_static         on;
 # gzip_static           on;
 gzip                  on;