How to turn off or specify the nginx error log location?

后端 未结 6 1369
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-01 11:09

I compiled the nginx on Ubuntu myself. I start my nginx with -c nginx.conf parameter. In my nginx.conf file, I try to turn off error log with but failed.

err         


        
6条回答
  •  醉话见心
    2021-01-01 12:00

    There's no need to use a command line parameter. Simply ensure you add the error_log directive to the very top of nginx.conf or at least before any error messages may occur.

    nh2's comment from Jan 2016 suggests that this option would have been available for at least a couple years now. I can confirm it works and it's less hassle. Customisation to nginx.conf is less likely to cause issues with updates to a packaged nginx installation than the alternatives.

提交回复
热议问题