nginxconfig.io icon indicating copy to clipboard operation
nginxconfig.io copied to clipboard

unknown log format "buffer=512k" in /etc/nginx/sites-enabled/mysite.conf

Open doggy8088 opened this issue 2 years ago • 0 comments

Information

https://whatismybrowser.com/w/WCK9JR7

Details

Open this link. You will find this:

access_log          /var/log/nginx/access.log buffer=512k flush=1m;

Here is the NGINX log:

2022-11-18 20:02:34 2022/11/18 12:02:34 [emerg] 1#1: unknown log format "buffer=512k" in /etc/nginx/sites-enabled/mysite.conf:15
2022-11-18 20:02:34 nginx: [emerg] unknown log format "buffer=512k" in /etc/nginx/sites-enabled/mysite.conf:15

Description

The generated /etc/nginx/sites-available/mysite.conf file contains a wrong format issue.

Steps to reproduce

  1. Open this link.

  2. I run this in Docker.

    image

Expected behavior

When I switch to the following, it works.

access_log          /var/log/nginx/access.log combined buffer=512k flush=1m;

Docs here: http://nginx.org/en/docs/http/ngx_http_log_module.html

Syntax:	access_log path [format [buffer=size] [gzip[=level]] [flush=time] [if=condition]];
access_log off;
Default:
access_log logs/access.log combined;
Context:	http, server, location, if in location, limit_except

I think it's missing format if the buffer must be used.

Screenshots

image

doggy8088 avatar Nov 18 '22 12:11 doggy8088