Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion RHEL/CentOS
  • Search

nginx start unknown log format "bytes"

RHEL/CentOS related topics
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
nmpribeiro
Posts: 13
Joined: Thu Nov 20, 2014 9:13 am

nginx start unknown log format "bytes"
  • Quote

Post by nmpribeiro » Tue Feb 09, 2016 4:34 pm

sudo service nginx start
Starting nginx: nginx: [emerg] unknown log format "bytes" in /home/admin/conf/web/nginx.conf:11
[FAILED]

On that file:
(...)
location / {
proxy_pass http://193.234.225.138:8080;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|$
root /home/admin/web/domain.com/public_html;
access_log /var/log/httpd/domains/domain.com.log combined;
access_log /var/log/httpd/domains/domain.com.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
(...)

Clueless... I'll try to update vesta with the script.
Last edited by nmpribeiro on Mon May 23, 2016 9:38 am, edited 1 time in total.
Top

nmpribeiro
Posts: 13
Joined: Thu Nov 20, 2014 9:13 am

Re: nginx start unknown log format "bytes"
  • Quote

Post by nmpribeiro » Tue Feb 09, 2016 6:57 pm

after some talk with the guys at freenode #nginx channel, I got into this documentation about 'log formats':
http://nginx.org/en/docs/http/ngx_http_ ... ml#example

Code: Select all

log_format compression '$remote_addr - $remote_user [$time_local] '
                       '"$request" $status $bytes_sent '
                       '"$http_referer" "$http_user_agent" "$gzip_ratio"';

access_log /spool/logs/nginx-access.log compression buffer=32k;
Basically we're making an alias 'compression' that can then be issued as a directive like that:

Code: Select all

access_log /spool/logs/nginx-access.log compression buffer=32k;
Knowing that, I've edited '/etc/nginx/nginx.conf' and between line 'log_format main (...)' inside http {
and before 'access_log'; basically defining a new alias for a log_format, I inserted the following:

Code: Select all

log_format  bytes   '$body_bytes_sent';
as the code pattern from viewtopic.php?t=4816 seams to indicate.

Hope this helps anyone that doesn't have an understanding of nginx and get's stuck on this error.
Top

pandabb
Posts: 192
Joined: Sat Aug 08, 2015 3:03 am

Re: nginx start unknown log format "bytes"
  • Quote

Post by pandabb » Tue Feb 09, 2016 7:40 pm

Thanks for the information.
Top

nmpribeiro
Posts: 13
Joined: Thu Nov 20, 2014 9:13 am

Re: nginx start unknown log format "bytes"
  • Quote

Post by nmpribeiro » Wed Feb 10, 2016 7:47 am

Basically, this means an update has packed the nginx.conf into nginx.conf.rpmsave (in my case) and written a new nginx.conf

Other problems might appear as well (in my case, I can't figure out how to make SSL's work heh)
Top

fredfontes
Posts: 7
Joined: Tue May 05, 2020 9:46 pm
Contact:
Contact fredfontes
Website

Os: Ubuntu 17x
Web: apache + nginx
Re: nginx start unknown log format "bytes"
  • Quote

Post by fredfontes » Sat May 01, 2021 8:06 pm

In my case they are pointing to the latest domain I have created on the pannel. Example: every domain are pointing to last_domain.com. If I suspend last_domain.com they will all point to last_last_domain.com...

I dont know what to do!!!
Top

inazeem
Posts: 7
Joined: Wed Jan 29, 2020 2:43 pm
Contact:
Contact inazeem
Website

Os: Ubuntu 17x
Web: apache + nginx
Re: nginx start unknown log format "bytes"
  • Quote

Post by inazeem » Wed Sep 29, 2021 6:13 pm

Does anyone figured this out. I am having the same issue. It is pointing to one site.
Top


Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “RHEL/CentOS”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password