Ngnix I can't get it to work

ngnix I can’t get it to work, it is a VPS that has been around for a long time (more than a year) at the time I added a second IP but in the end I ended up cancelling it.

Now when I need to restart nginx (for example to register a new domain) I get an error as it can not restart nginx and I find that 15 websites that are on that server do not work.

if I tell you:

systemctl status nginx.service
● nginx.service - nginx - high performance web server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2024-03-19 11:40:00 CET; 15s ago
Docs: nginx documentation
Process: 83758 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)

Mar 19 11:40:00 vps.dsya.center systemd[1]: Starting nginx - high performance web server…
Mar 19 11:40:00 vps.dsya.center nginx[83758]: nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /etc/nginx/conf.d/161.97.89.202.conf:37
Mar 19 11:40:00 vps.dsya.center nginx[83758]: nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /etc/nginx/conf.d/62.171.146.247.conf:37
Mar 19 11:40:00 vps.dsya.center nginx[83758]: nginx: [emerg] the shared memory zone “araquefem.es” is already declared for a different use in /etc/nginx/conf.d/fastcgi_cache_pool.conf:7
Mar 19 11:40:00 vps.dsya.center systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Mar 19 11:40:00 vps.dsya.center systemd[1]: nginx.service: Failed with result ‘exit-code’.
Mar 19 11:40:00 vps.dsya.center systemd[1]: Failed to start nginx - high performance web server.

La IP correcta es: 62.171.146.247

Muchas gracias por su paciencia

journalctl -xe
-- The process' exit code is 'exited' and its exit status is 1.
Mar 19 11:42:27 vps.dsya.center systemd[1]: crowdsec-firewall-bouncer.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit crowdsec-firewall-bouncer.service has entered the 'failed' state with result 'exit-code'.
Mar 19 11:42:27 vps.dsya.center systemd[1]: Failed to start The firewall bouncer for CrowdSec.
-- Subject: A start job for unit crowdsec-firewall-bouncer.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit crowdsec-firewall-bouncer.service has finished with a failure.
-- 
-- The job identifier is 6000 and the job result is failed.
Mar 19 11:42:36 vps.dsya.center systemd[1]: crowdsec.service: Scheduled restart job, restart counter is at 13.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit crowdsec.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Mar 19 11:42:36 vps.dsya.center systemd[1]: Stopped Crowdsec agent.
-- Subject: A stop job for unit crowdsec.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A stop job for unit crowdsec.service has finished.
-- 
-- The job identifier is 6069 and the job result is done.
Mar 19 11:42:36 vps.dsya.center systemd[1]: Starting Crowdsec agent...
-- Subject: A start job for unit crowdsec.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit crowdsec.service has begun execution.
-- 
-- The job identifier is 6069.
lines 2805-2842/2842 (END)

cat /etc/nginx/conf.d/fastcgi_cache_pool.conf

And araquefem.es is more then once

delete the last one

1 Like

Thank you very much for your reply, but I’m afraid I don’t understand what you are saying.

I can access the hestiaCP panel but if I try to delete any of the users or add a new domain to a user it returns the error

Error: nginx restart failed
Error: nginx restart failed
Error: web domain deletion failed

nano /etc/nginx/conf.d/fastcgi_cache_pool.conf

Check the config for duplicated lines with domain: araquefem.es
And delete them

Then systemctl restart nginx and it should work

Thank you very much for your time:

In the file you indicate there is no duplicate record, despite that I have deleted the domain completely.

After restarting hestia it doesn’t work either.

In any case, I don’t understand how fastcgi can affect nginx… at most one of the domains, but not the whole server.

The panel shows as if everything is ok, but none of the websites are working.

I’ll keep looking, thanks again

Error: web domain deletion failed

Do the following:

v-backup-users
2)
Find the name of that user, under which you have a problem with the domain.
3)
Make sure that the backup of that user has been made. Download the backup and try to open the compressed file. If you can open it, you will be able to restore it, I suppose.
4)
Delete the user. This will delete everything under it, including mail accounts, DNS and web.
5)
Find the full name of the backu of that user with its extension (zip/tar, etc). Then do:

v-restore-user username username-xx-xx-xx.tar

This will restore everything that was corrupted before in the respective config files of hestia. Thereafter, you will not have an error.