Nginxs not start when debian11 starting

I see that I need start nginx manually after restart debian11.

nginx.service - nginx - high performance web server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2023-07-03 22:19:30 EEST; 1min 45s ago
       Docs: https://nginx.org/en/docs/
    Process: 618 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
        CPU: 30ms

Jul 03 22:19:30 isp.domain.com nginx[618]: nginx: [warn] "ssl_stapling" ignored, host not found in OCSP responder "r3.o.lencr.org" in the certificate "/home/vi>
Jul 03 22:19:30 isp.domain.com nginx[618]: nginx: [warn] "ssl_stapling" ignored, host not found in OCSP responder "r3.o.lencr.org" in the certificate "/home/cr>
Jul 03 22:19:30 isp.domain.com nginx[618]: nginx: [warn] "ssl_stapling" ignored, host not found in OCSP responder "r3.o.lencr.org" in the certificate "/home/ad>
Jul 03 22:19:30 isp.domain.com nginx[618]: nginx: [warn] "ssl_stapling" ignored, host not found in OCSP responder "r3.o.lencr.org" in the certificate "/home/pr>
Jul 03 22:19:30 isp.domain.com nginx[618]: nginx: [warn] "ssl_stapling" ignored, host not found in OCSP responder "r3.o.lencr.org" in the certificate "/home/ul>
Jul 03 22:19:30 isp.domain nginx[618]: nginx: [warn] "ssl_stapling" ignored, host not found in OCSP responder "r3.o.lencr.org" in the certificate "/home/vi>
Jul 03 22:19:30 isp.domain.com nginx[618]: nginx: [emerg] bind() to 171.101.101.91:80 failed (99: Cannot assign requested address)
Jul 03 22:19:30 isp.domain.com systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Jul 03 22:19:30 isp.domain.com systemd[1]: nginx.service: Failed with result 'exit-code'.
Jul 03 22:19:30 isp.domain.com systemd[1]: Failed to start nginx - high performance web server.

I restart nginx from hestia and all work good up to next debian restart

Check if the ip address is still available via ip addr if yes run:
sysctl -w net.ipv4.ip_nonlocal_bind=1

if no

v-update-sys-ip if you have a dynamic ip address

I use vps from linode. Address is not changing or I dont understand you

Then run::

sysctl -w net.ipv4.ip_nonlocal_bind=1

and restart Nginx

the problem appears only when starting debian and does not appear during normal operation or restarting nginx

may I need edit the /etc/sysctl.conf or do something else?

Yes:

sysctl -w net.ipv4.ip_nonlocal_bind=1

Should solve the issue or change it in /etc/sysctl.conf

I make

sysctl -w net.ipv4.ip_nonlocal_bind=1

and restart debian. nginx is error and not started. I need to make “service start nginx” manually

then I add to the end of /etc/sysctl.conf

net.ipv4.ip_nonlocal_bind=1

and restart debian. Nginx started successfully. Only one line confuses:

isp.domain.com systemd[1]: nginx.service: Can’t open PID file /run/nginx.pid (yet?) after start: Operation not permitted”

Is my solution correct or should I have done it differently, for example adding a line to a separate file, for example /etc/sysctl.d/99-custom.conf ?