Dear Maintainer,
* What led up to the situation?
I have a dual IPv4/IPv6 server with nginx listening on both with the following directive:
server
{
server_name "example.org";
listen 144.202.24.41:443 default_server ssl http2;
listen [2001:19f0:5401:58:5400:3ff:fe59:e2b1]:443 default_server ssl http2;
...
}
When I reboot the server and login, systemctl report the following:
$ systemctl status nginx.service
× nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Sat 2023-01-07 16:17:40 EST; 50s ago
Docs: man:nginx(8)
Process: 481 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
CPU: 49ms
Jan 07 16:17:40 lj01 systemd[1]: Starting A high performance web server and a reverse proxy server...
Jan 07 16:17:40 lj01 nginx[481]: nginx: [emerg] bind() to [2001:19f0:5401:58:5400:3ff:fe59:e2b1]:443 failed (99: Cannot assign requested address)
Jan 07 16:17:40 lj01 nginx[481]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jan 07 16:17:40 lj01 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Jan 07 16:17:40 lj01 systemd[1]: nginx.service: Failed with result 'exit-code'.
Jan 07 16:17:40 lj01 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
* What exactly did you do (or not do) that was effective (or
ineffective)?
Restarting the nginx service resolves the issue.
This appears to be a dependency issue in the nginx.service file.