久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術文章
文章詳情頁

centos7 - nginx配置access_log問題

瀏覽:139日期:2024-06-17 14:01:16

問題描述

我想給nginx開啟訪問日志。百度了一下,主要是在nginx.conf中配置

centos7 - nginx配置access_log問題

這一段

# log_format main ’$remote_addr - $remote_user [$time_local] '$request' ’# ’$status $body_bytes_sent '$http_referer' ’# ’'$http_user_agent' '$http_x_forwarded_for'’;## access_log logs/access.log main;

默認都是加#注釋掉的,我想開啟,也就是這段都取消#注釋了。然后重啟nginx卻重啟不了,提示Job for nginx.service failed because the control process exited with error code. See 'systemctl status nginx.service' and 'journalctl -xe' for details.

把#加回去又沒事了,什么原因啊,包括開頭的錯誤日志

#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;

也是把#去掉想生效,結果nginx就啟動不了。`

問題解答

回答1:

1.請使用 nginx -t 檢查配置文件獲取 查看具體得錯誤信息

日志這樣處理

log_format main ’$remote_addr - $remote_user [$time_local] '$request' ’ ’$status $body_bytes_sent '$http_referer' ’ ’'$http_user_agent' '$http_x_forwarded_for'’; access_log logs/access.log main;

相關文章:
主站蜘蛛池模板: 呼伦贝尔市| 西乌珠穆沁旗| 新巴尔虎右旗| 陈巴尔虎旗| 商洛市| 榕江县| 沽源县| 吐鲁番市| 酒泉市| 洪雅县| 鸡西市| 高尔夫| 花垣县| 武清区| 沅江市| 丰台区| 大方县| 灵寿县| 延吉市| 曲靖市| 大理市| 二连浩特市| 大方县| 新平| 平泉县| 阿坝| 和平区| 清徐县| 锡林浩特市| 高密市| 濮阳县| 绥宁县| 桂阳县| 商河县| 昌乐县| 石柱| 江川县| 丹阳市| 民乐县| 从江县| 壶关县|