国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

centos7 - nginx配置access_log問題

瀏覽:123日期: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;

也是把#去掉想生效,結(jié)果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;

相關(guān)文章:
主站蜘蛛池模板: 铜陵市| 天柱县| 淮南市| 诸城市| 理塘县| 常山县| 齐河县| 师宗县| 延川县| 高阳县| 沿河| 丹阳市| 原阳县| 杭锦旗| 广丰县| 扎赉特旗| 峡江县| 佛教| 云和县| 仲巴县| 南陵县| 赤壁市| 黔西县| 怀远县| 嵊泗县| 民县| 丘北县| 临夏县| 铁力市| 牙克石市| 西林县| 兰溪市| 贺兰县| 萨嘎县| 阿合奇县| 靖边县| 南康市| 左贡县| 满洲里市| 灵寿县| 南平市|