Nginx status error

Hello for all…
I was checking my nginx status and I encounter this error, I couldn’t be able to know what causes this:
frappe@jwe-Standard-PC-i440FX-PIIX-1996:~/frappe-bench$ sudo systemctl status nginx
[sudo] password for frappe: **
× nginx.service - A high performance web server and a reverse proxy server
** Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)

** tive: failed (Result: exit-code) since Sat 2024-10-19 19:20:35 +03; 22h ago
Duration: 22h 10min 38.076s
Docs: man:nginx(8)
Process: 31983 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, st>
Process: 31985 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FA>
CPU: 15ms

Oct 19 19:20:33 jwe-Standard-PC-i440FX-PIIX-1996 nginx[31985]: nginx: [emerg] bind() to 0.0.0.0:80 fail>
Oct 19 19:20:33 jwe-Standard-PC-i440FX-PIIX-1996 nginx[31985]: nginx: [emerg] bind() to [::]:80 failed >
Oct 19 19:20:34 jwe-Standard-PC-i440FX-PIIX-1996 nginx[31985]: nginx: [emerg] bind() to 0.0.0.0:80 fail>
Oct 19 19:20:34 jwe-Standard-PC-i440FX-PIIX-1996 nginx[31985]: nginx: [emerg] bind() to [::]:80 failed >
Oct 19 19:20:34 jwe-Standard-PC-i440FX-PIIX-1996 nginx[31985]: nginx: [emerg] bind() to 0.0.0.0:80 fail>
Oct 19 19:20:34 jwe-Standard-PC-i440FX-PIIX-1996 nginx[31985]: nginx: [emerg] bind() to [::]:80 failed >
Oct 19 19:20:35 jwe-Standard-PC-i440FX-PIIX-1996 nginx[31985]: nginx: [emerg] still could not bind()
Oct 19 19:20:35 jwe-Standard-PC-i440FX-PIIX-1996 systemd[1]: nginx.service: Control process exited, cod>
Oct 19 19:20:35 jwe-Standard-PC-i440FX-PIIX-1996 systemd[1]: nginx.service: Failed with result 'exit-co>
Oct 19 19:20:35 jwe-Standard-PC-i440FX-PIIX-1996 systemd[1]: Failed to start nginx.service - A high per>
lines 1-19/19 (END)

by the way my ERPNext work well despite this error. when I try to stop the nginx the site still work and when I try to start it I get:
Job For nginx.service failed because the control process exited with error code.
See “systemctl status nginx.service” and “journalctl -xeu nginx.service” For details

anyone have this issue before…?

sudo nginx -t

Try this command and check configuration is right if right means again try to setup the nginx using bench setup nginx try this and if u have any issue after trying this then let me know

@Vijayan_R What I’m trying to do is install SSL on my Nginx website. So far, I haven’t been able to access the site securely from outside my network (I can open it with a secure connection inside the LAN, but from outside, it’s not working). Despite this, I can:

  1. Ping my site from the WAN (outside my network).
  2. Run sudo nginx -t without any errors.
  3. Open port 443 on my router.

One thing I’ve noticed is that when I stop Nginx, the site keeps running, even though the Nginx status shows that it is stopped.
I’ve seen a lot of reference out there talk about installing SSL certificate but none of them have worked for me.

Try setting up Nginx again and adjust the configuration as needed for the Bench.
Follow these links for guidance:
https://frappeframework.com/docs/user/en/bench/guides/setup-production
https://frappeframework.com/docs/user/en/bench/guides/lets-encrypt-ssl-setup

If you encounter any errors, let me know.

@Vijayan_R
Hello My friend, I get this error:
Could not bind TCP port 80 because it is already in use by another process on
this system (such as a web server). Please stop the program in question and then
try again.
I tried to Comment out the server block for port 80 in
/etc/nginx/conf.d/frappe-bench.conf & /etc/nginx/sites-available/default
but that’s also doesn’t work and still give me the same message