我在我的应用程序中使用nginx作为反向代理。我有一个附带的用例。用户可以使用geth附加https://dns-name:port/api-key来获取geth控制台。示例:
如果出现错误,nginx error_log将显示每个键。示例:
11:32:14错误48#0:*12479669 connect()失败(111个:连接被拒绝),客户端:1*4.*.01,服务器:_,请求:"POST /api/1.1“,
上游:“http://127.0.0.1*”,主机:"*******.******.****.com:port“
我读了nginx文档,没有办法为error_log使用日志格式。是否有任何方法配置此error_log。我不想在日志中显示这个api键。
发布于 2020-02-04 07:56:45
更简单的配置示例:只是在nginx配置文件error_log off
中添加一行,但请记住,没有创建error_log文件
http {
access_log /var/log/nginx/access.log main;
server {
listen 80;
location /app1 {
error_log off; # <----- this WILL work
proxy_pass http://example.com;
}
(...)
}
}
https://stackoverflow.com/questions/60050280
复制相似问题