How to repair nginx without reinstalling the panel

In the saga of trying to install the rtmp module on nginx, I reinstalled nginx and lost their and the sites’ configuration files, and now the sites don’t work.
I can’t make a backup to reinstall from scratch, as there are more than 3TB of files.

Do you have any solution?

rm /etc/nginx/nginx.conf 
cp /usr/local/hestia/install/deb/nginx/nginx.conf /etc/nginx/nginx.conf

I managed this part of the configuration, but the sites’ configuration files disappeared, as well as the domain directory.

Create the /etc/nginx/domains/ again

And run v-rebuild-web-domains and v-rebuild-mail-domains for all users

And it should be recreated …

1 Like

The command worked and recreated the sites’ nginx files, but nginx still has an error that I’m not finding.

nginx: [emerg] unknown “anti_replay” variable
nginx: configuration file /etc/nginx/nginx.conf test failed

What Ngixn version are you running?


HestiaCP uses directives supported by newer nginx.
In example, new http2 directive is supported by nginx 1.25.1 or newer.

Update nginx for that version and continue the same thing

nginx: [emerg] unknown “anti_replay” variable
nginx: configuration file /etc/nginx/nginx.conf test failed

Is it nginx 1.25.3 from repository?

Yes, even installing the hls module in nginx gives me an error, I’ll try to get a dedicated one from Hetzner or Reliablesite.
I noticed that for VOD hestia doesn’t seem like the best solution, I’m just hosting hls files via ftp and playing the videos via the url.
I was just using it to make setup easier.