# Cannot restart Nginx after deleting letsencrypt certificate

**URL:** <https://community.letsencrypt.org/t/cannot-restart-nginx-after-deleting-letsencrypt-certificate/192594>\
**Category:** Help\
**Created:** [February 10, 2023, 9:52am UTC](https://community.letsencrypt.org/t/cannot-restart-nginx-after-deleting-letsencrypt-certificate/192594 "2023-02-10T09:52:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![maheshmore1](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/maheshmore1/32/67687_2.png) [@maheshmore1](https://community.letsencrypt.org/u/maheshmore1)\
**Post date:** [February 10, 2023, 9:52am UTC](https://community.letsencrypt.org/t/cannot-restart-nginx-after-deleting-letsencrypt-certificate/192594/1 "2023-02-10T09:52:03Z")

</div>

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. [crt.sh | example.com](https://crt.sh/?q=example.com)), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: [mobilitytechnews.net](http://mobilitytechnews.net)

I ran this command: sudo systemctl restart nginx

It produced this output:  
nginx[4400]: nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/mobilitytechnews.net-0001/fullchain.p\>  
nginx[4400]: nginx: configuration file /etc/nginx/nginx.conf test failed  
systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE  
systemd[1]: nginx.service: Failed with result 'exit-code'.  
systemd[1]: Failed to start A high performance web server and a reverse proxy server.

My web server is (include version): nginx/1.18.0 (Ubuntu)

The operating system my web server runs on is (include version): Ubuntu

My hosting provider, if applicable, is: AWS EC2

I can login to a root shell on my machine (yes or no, or I don't know): Yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): No (using ec2 instance t2.micro)

The version of my client is (e.g. output of `certbot --version` or `certbot-auto --version` if you're using Certbot):

nginx.conf file:

```plaintext
user www-data;
worker_processes auto;
pid /run/nginx.pid;
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;
	client_max_body_size 512M;

	##
	# 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/*;
}

#mail {
#	# See sample authentication script at:
#	# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#	# 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;
#	}
#}

```

---

<div class="post-metadata">

**Author:** ![danb35](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/danb35/32/70869_2.png) [@danb35](https://community.letsencrypt.org/u/danb35)\
**Post date:** [February 10, 2023, 12:18pm UTC](https://community.letsencrypt.org/t/cannot-restart-nginx-after-deleting-letsencrypt-certificate/192594/2 "2023-02-10T12:18:23Z")

</div>

> [@maheshmore1](#):
>
> nginx[4400]: nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/mobilitytechnews.net-0001/fullchain.p\>

You've deleted the certificate (why?), but your nginx configuration still requires that certificate. You'll need to fix your nginx configuration to no longer require that cert.

---

<div class="post-metadata">

**Author:** ![Bruce5051](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/bruce5051/32/76576_2.png) [@Bruce5051](https://community.letsencrypt.org/u/Bruce5051)\
**Post date:** [February 10, 2023, 3:41pm UTC](https://community.letsencrypt.org/t/cannot-restart-nginx-after-deleting-letsencrypt-certificate/192594/3 "2023-02-10T15:41:30Z")

</div>

Here you can read [nginx documentation](http://nginx.org/en/docs/)

---

<div class="post-metadata">

**Author:** ![maheshmore1](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/maheshmore1/32/67687_2.png) [@maheshmore1](https://community.letsencrypt.org/u/maheshmore1)\
**Post date:** [February 13, 2023, 7:54am UTC](https://community.letsencrypt.org/t/cannot-restart-nginx-after-deleting-letsencrypt-certificate/192594/4 "2023-02-13T07:54:00Z")

</div>

I got this issue resolved by installing letsencrypt certificate again.

Needed to take help from a developer with nginx knowledge.

---

<div class="post-metadata">

**Author:** ![Bruce5051](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/bruce5051/32/76576_2.png) [@Bruce5051](https://community.letsencrypt.org/u/Bruce5051)\
**Post date:** [February 13, 2023, 3:35pm UTC](https://community.letsencrypt.org/t/cannot-restart-nginx-after-deleting-letsencrypt-certificate/192594/5 "2023-02-13T15:35:12Z")

</div>

> [@maheshmore1](#):
>
> Needed to take help from a developer with nginx knowledge.

Please see the [https://forum.nginx.org/](https://forum.nginx.org/) for assistance with nginx.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [March 15, 2023, 3:35pm UTC](https://community.letsencrypt.org/t/cannot-restart-nginx-after-deleting-letsencrypt-certificate/192594/6 "2023-03-15T15:35:19Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
