Nginx config test failed after create new domain

kaori14112

New member
Joined
Mar 23, 2019
Messages
4
Hello,
I'm using Direct Admin on Centos 6.10.
DA still working fine until i create new domain (ex domain.com).
When i type nginx -t it's show this error "nginx: [emerg] unknown log format "main" in /usr/local/directadmin/data/users/admin/nginx.conf:18"
Here is that line: access_log /var/log/nginx/domains/domain.com.log main buffer=16k;
An error only happen when i create new domain, seem like it was loaded from some default config files?
I already ./build update, ./build nginx_apache and ./build rewrite_confs
Here is my option.conf in custombuild (2.0):

Code:
#PHP Settings
php1_release=5.6
php1_mode=fastcgi
php2_release=5.4
php2_mode=fastcgi
php3_release=7.0
php3_mode=fastcgi
php4_release=7.2
php4_mode=fastcgi
secure_php=no
opcache=no
htscanner=no
php_ini=no
php_timezone=America/New_York
php_ini_type=production
ioncube=no
zend=no
suhosin=no
x_mail_header=yes

#MySQL Settings
mysql=5.6
mariadb=10.0
mysql_inst=no
mysql_backup=yes
mysql_backup_gzip=no
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups
mysql_force_compile=no

#WEB Server Settings
webserver=nginx_apache
http_methods=GET:HEAD:POST
litespeed_serialno=trial
modsecurity=no
modsecurity_ruleset=comodo
apache_ver=2.4
apache_mpm=auto
mod_ruid2=no
userdir_access=yes
harden_symlinks_patch=yes
use_hostname_for_alias=no
redirect_host=ProSSD3.22885
redirect_host_https=no

#WEB Applications Settings
phpmyadmin=yes
phpmyadmin_ver=4
squirrelmail=no
roundcube=yes
webapps_inbox_prefix=no

#ClamAV-related Settings
clamav=no
clamav_exim=yes
modsecurity_uploadscan=no
proftpd_uploadscan=no
pureftpd_uploadscan=no
suhosin_php_uploadscan=no

#Mail Settings
exim=yes
eximconf=yes
eximconf_release=4.5
blockcracking=no
easy_spam_fighter=no
spamd=no
sa_update=daily
dovecot=yes
dovecot_conf=yes
pigeonhole=no

#FTP Settings
ftpd=pureftpd

#Statistics Settings
awstats=no
webalizer=yes

#CustomBuild Settings
custombuild=2.0
autover=no
bold=yes
clean=yes
cleanapache=yes
clean_old_tarballs=yes
clean_old_webapps=yes
downloadserver=files.directadmin.com

#Cronjob Settings
cron=no
cron_frequency=weekly

[email protected]
notifications=yes
da_autoupdate=no
updates=no
webapps_updates=yes

#CloudLinux Settings
cloudlinux=no
cloudlinux_beta=no
cagefs=no

#Advanced Settings
autoconf=yes
automake=yes
libtool=yes
curl=yes
new_pcre=yes

Please help me, sorry about my english.
If you need anything just ask.
Thank you for helping me.
 
Hello,

Open /etc/nginx/nginx-includes.conf in a console editor, and add:


Code:
log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
   '$status $body_bytes_sent "$http_referer" '
   '"$http_user_agent" "$http_x_forwarded_for" '
   'rt=$request_time ua="$upstream_addr" '
   'us="$upstream_status" ut="$upstream_response_time" '
   'ul="$upstream_response_length" '
   'cs=$upstream_cache_status' ;

It should help.
 
Thank you very much for helping me.
I figured out that because some custom configuration files load when create new domain. It's located at /usr/local/directadmin/data/templates/custom/
But i'll tried with your suggestion.
Thank you.
 
Back
Top