Welcome! Log In Create A New Profile

Advanced

Re: nginx does not start automatically, what have I done?

Maxim Dounin
February 16, 2023 09:20AM
Hello!

On Thu, Feb 16, 2023 at 02:48:23PM +0800, JK wrote:

> Hello, it is my first time posting here, and I appreciate the
> opportunity to share my experience with nginx.
>
>
> Just to give you background, I am using a VPS from Racknerd, and I use
> CWP (Control Web Panel), which is pretty similar to cPanel.
>
>
> I tried to update the repo and use dnf upgrade -y, and what happened
> was, after restarting the server, nginx did not start automatically.
>
>
> Here is the log of nginx:
>
>
> ● nginx.service - The nginx HTTP and reverse proxy server
> Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled;
> vendor preset: disabled)
> Active: failed (Result: exit-code) since Wed 2023-02-15 17:29:03
> EST; 7h ago
> Process: 779 ExecStartPre=/usr/sbin/nginx -t (code=exited,
> status=1/FAILURE)
> Process: 776 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited,
> status=0/SUCCESS)
> Feb 15 17:29:02 racknerd-f5**** systemd[1]: Starting The nginx HTTP and
> reverse proxy server...
> Feb 15 17:29:02 racknerd-f5**** nginx[779]: nginx: the configuration
> file /etc/nginx/nginx.conf syntax is ok
> Feb 15 17:29:03 racknerd-f5**** nginx[779]: nginx: [emerg] bind() to
> 100.xx.xx.xx:80 failed (99: Cannot assign requested address)
> Feb 15 17:29:03 racknerd-f5**** nginx[779]: nginx: configuration file
> /etc/nginx/nginx.conf test failed
> Feb 15 17:29:03 racknerd-f5**** systemd[1]: nginx.service: Control
> process exited, code=exited status=1
> Feb 15 17:29:03 racknerd-f5**** systemd[1]: nginx.service: Failed with
> result 'exit-code'.
> Feb 15 17:29:03 racknerd-f5**** systemd[1]: Failed to start The nginx
> HTTP and reverse proxy server.
>
>
> The solution is to manually start nginx after a minute or two.

The error message "bind() to 100.xx.xx.xx:80 failed (99: Cannot
assign requested address)" suggests the IP address you are trying
to use is not available when nginx starts.

Possible options to fix this include:

- Make sure nginx systemd service properly depends on the network
being available (After=/Wants= network-online.target is usually
good enough, though you may need to also enable proper wait
service, see [1]).

- Reconfigure nginx to listen on the wildcard address instead, so
it won't try to bind on IP addresses not yet available when it
starts.

Hope this helps.

[1] https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx does not start automatically, what have I done?

AdventureTime February 16, 2023 02:46AM

Re: nginx does not start automatically, what have I done?

Maxim Dounin February 16, 2023 09:20AM

Re: nginx does not start automatically, what have I done?

AdventureTime February 16, 2023 10:16AM

Re: nginx does not start automatically, what have I done?

Maxim Dounin February 17, 2023 06:32AM

Re: nginx does not start automatically, what have I done?

AdventureTime February 17, 2023 07:36AM

Re: nginx does not start automatically, what have I done?

Maxim Dounin February 17, 2023 08:06AM

Re: nginx does not start automatically, what have I done?

AdventureTime February 17, 2023 08:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 134
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready