jac*_*013 2 web-services nginx server
我收到此错误:
Restarting nginx: nginx: [emerg] duplicate "log_format" name "timed_combined" in /etc/nginx/sites-enabled/default:8
nginx: configuration file /etc/nginx/nginx.conf test failed
Run Code Online (Sandbox Code Playgroud)
每当我尝试启动或重新启动我的 nginx 服务器时。这在以前不会发生。这是我的前几行代码/etc/nginx/sites-enabled/default
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts
log_format timed_combined '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time';
Run Code Online (Sandbox Code Playgroud)
小智 5
“timed_combined” log_format 是在源中预定义的;你需要使用你的名字,比如:
log_format my_log '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time';
之后需要重新定义access_log:
access_log /path/to/access.log my_log
| 归档时间: |
|
| 查看次数: |
3620 次 |
| 最近记录: |