# Getting Unauthorized exception when encrypting

**URL:** <https://community.letsencrypt.org/t/getting-unauthorized-exception-when-encrypting/238878>\
**Category:** Help\
**Created:** [June 28, 2025, 11:05am UTC](https://community.letsencrypt.org/t/getting-unauthorized-exception-when-encrypting/238878 "2025-06-28T11:05:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![smiraj](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@smiraj](https://community.letsencrypt.org/u/smiraj)\
**Post date:** [June 28, 2025, 11:05am UTC](https://community.letsencrypt.org/t/getting-unauthorized-exception-when-encrypting/238878/1 "2025-06-28T11:05:20Z")

</div>

Facing issue in creating certification. Please check the information that I am passing.

My domain is: [security.shishunir.com](http://security.shishunir.com)

I ran this command: sudo certbot --nginx -d [security.shishunir.com](http://security.shishunir.com) -d [www.security.shishunir.com](http://www.security.shishunir.com)

It produced this output:  
Saving debug log to /var/log/letsencrypt/letsencrypt.log  
Requesting a certificate for [security.shishunir.com](http://security.shishunir.com) and [www.security.shishunir.com](http://www.security.shishunir.com)

Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:  
Domain: [security.shishunir.com](http://security.shishunir.com)  
Type: unauthorized  
Detail: 125.253.92.186: Invalid response from [http://security.shishunir.com/.well-known/acme-challenge/RRXVTjaqi7WvBYd7SjTKRk\_HC0W4NAh0EvmB1Z1GJ0Y:](http://security.shishunir.com/.well-known/acme-challenge/RRXVTjaqi7WvBYd7SjTKRk_HC0W4NAh0EvmB1Z1GJ0Y:) 404

Domain: [www.security.shishunir.com](http://www.security.shishunir.com)  
Type: unauthorized  
Detail: 125.253.92.186: Invalid response from [http://www.security.shishunir.com/.well-known/acme-challenge/V-pg0C61RTTqksmXL-aj7N42ZyKWkqbxakTOo3Tf0pU:](http://www.security.shishunir.com/.well-known/acme-challenge/V-pg0C61RTTqksmXL-aj7N42ZyKWkqbxakTOo3Tf0pU:) 404

Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.

My web server is (include version): nginx/1.24.0

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

My hosting provider, if applicable, is: aws

I have also check with nginx -T and it gives:  
2025/06/28 11:05:01 [warn] 8422#8422: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1  
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok  
2025/06/28 11:05:01 [emerg] 8422#8422: open() "/run/nginx.pid" failed (13: Permission denied)  
nginx: configuration file /etc/nginx/nginx.conf test failed

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [June 28, 2025, 11:31am UTC](https://community.letsencrypt.org/t/getting-unauthorized-exception-when-encrypting/238878/2 "2025-06-28T11:31:56Z")

</div>

> [@smiraj](#):
>
> 2025/06/28 11:05:01 [emerg] 8422#8422: open() "/run/nginx.pid" failed (13: Permission denied)  
> nginx: configuration file /etc/nginx/nginx.conf test failed

You need to fix this `emerg` level error. Your nginx system cannot be started until you fix that. This is a general problem on your nginx install. Search the internet for that error message and you will get many suggestions. Or, ask your hosting provider (if any) for advice.

Once your nginx system is working and responding to HTTP requests you can try Certbot again.

Both HTTP and HTTPS requests to your domain are currently working. An HTTPS request even uses a certificate from Let's Encrypt issued just a few hours ago. So, I am not sure what purpose this broken nginx has. You may need to review your overall webserver plan.

---

<div class="post-metadata">

**Author:** ![smiraj](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@smiraj](https://community.letsencrypt.org/u/smiraj)\
**Post date:** [June 28, 2025, 6:32pm UTC](https://community.letsencrypt.org/t/getting-unauthorized-exception-when-encrypting/238878/3 "2025-06-28T18:32:00Z")

</div>

Hlw MikeMcQ,  
By mistake I missed sudo. When gave the command as **sudo nginx -T** , I got

> nginx: the configuration file /etc/nginx/nginx.conf syntax is ok  
> nginx: configuration file /etc/nginx/nginx.conf test is successful

But the certification result is same. Getting

> Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:  
> Domain: [security.shishunir.com](http://security.shishunir.com)  
> Type: unauthorized  
> Detail: 125.253.92.186: Invalid response from [http://security.shishunir.com/.well-known/acme-challenge/rnv2fu0L4OIKxtLhFnw3glGGpcnxN5OgT8ERZj4sUjw:](http://security.shishunir.com/.well-known/acme-challenge/rnv2fu0L4OIKxtLhFnw3glGGpcnxN5OgT8ERZj4sUjw:) 404
> 
> Domain: [www.security.shishunir.com](http://www.security.shishunir.com)  
> Type: unauthorized  
> Detail: 125.253.92.186: Invalid response from [http://www.security.shishunir.com/.well-known/acme-challenge/krhVa\_sGwAyTkq72omMGpkT977Mk1Fnlj0-BXCVnAUo:](http://www.security.shishunir.com/.well-known/acme-challenge/krhVa_sGwAyTkq72omMGpkT977Mk1Fnlj0-BXCVnAUo:) 404

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [June 28, 2025, 8:08pm UTC](https://community.letsencrypt.org/t/getting-unauthorized-exception-when-encrypting/238878/4 "2025-06-28T20:08:01Z")

</div>

> [@smiraj](#):
>
> But the certification result is same. Getting
> 
> > Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:  
> > Domain: [security.shishunir.com](http://security.shishunir.com)  
> > Type: unauthorized  
> > Detail: 125.253.92.186: Invalid response from [http://security.shishunir.com/.well-known/acme-challenge/rnv2fu0L4OIKxtLhFnw3glGGpcnxN5OgT8ERZj4sUjw:](http://security.shishunir.com/.well-known/acme-challenge/rnv2fu0L4OIKxtLhFnw3glGGpcnxN5OgT8ERZj4sUjw:) 404

The "404" in that error means "Not Found". The Let's Encrypt server made that HTTP challenge request to your server but your system said it was not found.

The --nginx option configures your local nginx system to reply to the LE HTTP Challenge. But, it looks like something other than nginx is replying.

If I do a curl to your domain I get redirected to an IP address that is different than what you have in your DNS for this domain

```nohighlight
curl -i http://security.shishunir.com
HTTP/1.1 301 Moved Permanently
location: http://13.232.120.85

```

And, at that different IP an nginx system replies.

Can you explain what you are trying to accomplish? Because I don't think this exact configuration of DNS and servers will work as you expect

```nohighlight
curl -i http://13.232.120.85/
HTTP/1.1 200 OK
Server: nginx/1.24.0 (Ubuntu)

```

Your DNS for your domain

```nohighlight
nslookup security.shishunir.com
Address: 125.253.92.186

```

---

<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:** [July 28, 2025, 8:08pm UTC](https://community.letsencrypt.org/t/getting-unauthorized-exception-when-encrypting/238878/5 "2025-07-28T20:08:29Z")

</div>

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