Nginx log error

After launching “bench setup nginx” i get error “unknown main log format” on nginx service .

Deactivating the access log (just comment the line on nginx.conf) it works. But will broke again after executing bench setup nginx …

Frappe v14 and Ubuntu 22.04
Any ideas?

Thanks

Oh, you brave and adventurous v14 pioneers; I salute you! :superhero:

Can you paste or screenshot the portion of 'nginx.conf' that you commented out, and tell me what version of Nginx you’re using?

1 Like

The log_format is missing.

in /etc/nginx/sites-enabled/frappe.conf should include as following

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

Add the format above server { }.

4 Likes

The log_format is by default in nginx.conf under the http block

You donot need to specify them in frappe.conf and if you need to specify , it needs to be under http block

1 Like

The log_format is missing in frappe.conf (only exist in frappe-bench/config/nginx.conf) when I installed new v14 for development. I might miss something during installation.

It should be done.

sudo ln -s ./config/nginx.conf /etc/nginx/sites-enabled/frappe.conf

Thanks to everyone. :wink: