How do I reset the nginx.conf file to the default?

How do I reset the nginx.conf file to the default? When I updated my ngnix today, instead of typing N, I just typed it. I’m not sure if it changed the file.

Thank you.

Check if the file changed:

md5sum /etc/nginx/nginx.conf
md5sum /usr/local/hestia/install/deb/nginx/nginx.conf

If the file is not the same:

cp -f /usr/local/hestia/install/deb/nginx/nginx.conf  /etc/nginx/nginx.conf

Anyway, if apt/dpkg modified some conf files, you should have a backup of the file with the extension dpkg-old

2 Likes

Thanks, they were different, is there any other file that is modified when ngnix updates something named .log?

find /etc/nginx/ -iname "*dpkg-*" -exec ls -l {} \;
2 Likes
xxx@xxxx:~# find /etc/nginx/ -iname "*dpkg-*" -exec ls -l {} \;
-rw-r--r-- 1 root root 644 Apr 16 09:14 /etc/nginx/nginx.conf.dpkg-dist

/etc/nginx/nginx.conf.dpkg-dist is the default configuration provided by the Nginx package. This means that no file has been modified.

If nginx.conf was different, it’s because Hestia modified the resolver settings in nginx.conf file to use the ones used by your server.

1 Like
xxxx@xxxx:~# cat /etc/nginx/nginx.conf.dpkg-dist

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

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

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}
xxxx@xxxx:~#

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.