Nginx webserver not restart after vps reboot

OS type and version Ubuntu 22.04
Webmin version 2.105
Virtualmin version 7.9.0

Installed with
sudo sh --bundle LEMP -m

and when i rebooted the server, Nginx webserver no longer auto start/restart.

How to fix it?

What do you mean “no longer”. you should install on a clean system.
I’ve never used the -m switch so no sure what that might do. I’d leave that off next time.

-m is for minimal installation. No longer restart means the nginx webserver not start automatically when i restart the vps so it need to be manually restarted.

You need to check the logs from the restart point, otherwise its a guessing game. I mean the service is set to Start on reboot I guess. I don’t run nginx but it should say yes for that service

i rechecked and it shows this after reboot. It is enabled to run/start after boot but it is not running. where i can see the log?

a quick way to see the failure is to run

service nginx status

as root

not able to understand the error.

something already appears to be running on port 443

ss -ltp ‘( dport = :443 or sport = :443 )’

to see what is using port 443, if anything and also look at the config file /etc/nginx/nginx.conf.
I have never used nginx as I have no issues with apache, but with apache you can define the listening port more than once, if you do that apache fails with a similar message


user www-data;
worker_processes auto;
pid /run/;
include /etc/nginx/modules-enabled/*.conf;

events {
	worker_connections 768;
	# multi_accept on;

http {

	# Basic Settings

	sendfile on;
	tcp_nopush on;
	types_hash_max_size 2048;
	# server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	# SSL Settings

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
	ssl_prefer_server_ciphers on;

	# Logging Settings

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	# Gzip Settings

	gzip on;

	# gzip_vary on;
	# gzip_proxied any;
	# gzip_comp_level 6;
	# gzip_buffers 16 8k;
	# gzip_http_version 1.1;
	# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

	# Virtual Host Configs

	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
	server_names_hash_bucket_size 128;

#mail {
#	# See sample authentication script at:
#	#
#	# auth_http localhost/auth.php;
#	# pop3_capabilities "TOP" "USER";
#	# imap_capabilities "IMAP4rev1" "UIDPLUS";
#	server {
#		listen     localhost:110;
#		protocol   pop3;
#		proxy      on;
#	}
#	server {
#		listen     localhost:143;
#		protocol   imap;
#		proxy      on;
#	}

Not getting any info related to the issue.

is the full error log, but I see no listen statements, they must be defined in

one of these locations have a look there for errors, really you need someone who uses nginx to trouble shoot this

Uploading: image.png…

checked and it seems like SSL is on port 443.


have listen myipaddresshere:443 ssl;

An old issue (that still seems to resurface) even the fix given here does not fully resolve it :frowning:

1 Like

the above post having error in editing so adding the error.log here

I would be happy to give the access if devs want to look. Also there is the connection error on the dashboard in every few random minutes which is related with the theme is open.

Bind errors?
Is your DNS managed by Virtualmin or externally (all of mine are managed externally on the VM provider (eg Linode / Digital Ocean, etc) that difference might be relevant.

DNS is via Cloudflare. Here what i have running. I am not using BIND DNS, POSTFIX AND IMAP.

just installed nginx on ubuntu & virtualmin the domain.conf file looks different

maybe make the config the same as this for your domains and try to restart nginx

Hi, there is a WordPress install so i see some additional rules however the port 443 is still for SSL.

I would just remove the wordpress bits … there could be a syntax error in there … maybe

Ah, so not a minimal install - WP has been added.
so has a WP site been added (potentially with all of its plugins)
We now have a pile of PHP code - that means a few PHP checks should be made on the setup. like what PHP execution mode, version, is WP accessing a database?