首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

Nginx的日志功能

通常,在生产环境中使用 Nginx 进行反向代理和负载均衡或者各种其他处理时,良好的日志记录是非常关键的一环。通过精心配置的 Nginx 日志,我们可以获取用户的真实 ip、浏览器信息,请求处理时间,请求URL等,这样方便我们排查和回溯错误。具体要记录哪些信息,可以通过 Nginx 中的 log_format 指令定义,由它定义日志的格式。而对于使用哪种日志格式和设置日志的保存路径则由 access_log 指令指定的。另外在 Nginx 中还有一个配置服务器和请求处理过程中的错误信息的指令,那就是 error_log指令。最后,如果在配置的日志文件路径中使用了变量,我们可以通过open_log_file_cache指令来设置缓存,提升性能。对于大型的网站而言,大量的 http 请求意味着大量的日志记录,及时按天或按大小进行 Nginx 日志备份也至关重要的。

02

Nginx 性能调优

NGINX is well known as a high performance load balancer, cache and web server, powering over 40% of the busiest websites in the world.  Most of the default NGINX and Linux settings work well for most use cases, but it can be necessary to do some tuning to achieve optimal performance.  This blog post will discuss some of the NGINX and Linux settings to consider when tuning a system.  There are many settings available, but for this post we will cover the few settings recommended for most users to consider adjusting.  The settings not covered in this post are ones that should only be considered by those with a deep understanding of NGINX and Linux, or after a recommendation by the NGINX support or professional services teams.  NGINX professional services has worked with some of the world’s busiest websites to tune NGINX to get the maximum level of performance and are available to work with any customer who needs to get the most out of their system.

02
领券