digitalocean / nginxconfig.io

⚙️ NGINX config generator on steroids 💉
https://do.co/nginxconfig
MIT License
27.66k stars 2.04k forks source link

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

Closed doggy8088 closed 1 year ago

doggy8088 commented 1 year ago

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