# Failure Automatic setting redirect HTTP traffic to HTTPS

**URL:** <https://community.letsencrypt.org/t/failure-automatic-setting-redirect-http-traffic-to-https/100865>\
**Category:** Help\
**Created:** [August 28, 2019, 3:45pm UTC](https://community.letsencrypt.org/t/failure-automatic-setting-redirect-http-traffic-to-https/100865 "2019-08-28T15:45:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rom323](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rom323](https://community.letsencrypt.org/u/rom323)\
**Post date:** [August 28, 2019, 3:45pm UTC](https://community.letsencrypt.org/t/failure-automatic-setting-redirect-http-traffic-to-https/100865/1 "2019-08-28T15:45:11Z")

</div>

Hi all,

Certbot was really going well until last step (“redirect or not to redirect”). I’ve selected Redirect and setting aborted with an error. Even this issue nginx keeps working fine.  
What is wrong with certob?

My domain is:dev01.intsercom.cl

I ran this command: certbot --nginx

It produced this output:  
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.

* * *

1: No redirect - Make no further changes to the webserver configuration.  
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for  
new sites, or if you’re confident your site works on HTTPS. You can undo this  
change by editing your web server’s configuration.

* * *

Select the appropriate number [1-2] then [enter] (press ‘c’ to cancel): 2  
Redirecting all traffic on port 80 to ssl in /etc/nginx/sites-enabled/default  
nginx: [emerg] a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/default:22  
Rolling back to previous server configuration…  
nginx: [emerg] a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/default:22  
Encountered exception during recovery:  
Traceback (most recent call last):  
File “/usr/lib/python3/dist-packages/certbot/client.py”, line 569, in enhance\_config  
self.installer.restart()  
File “/usr/lib/python3/dist-packages/certbot\_nginx/configurator.py”, line 881, in restart  
nginx\_restart(self.conf(‘ctl’), self.nginx\_conf)  
File “/usr/lib/python3/dist-packages/certbot\_nginx/configurator.py”, line 1141, in nginx\_restart  
“nginx restart failed:\n%s\n%s” % (out.read(), err.read()))  
certbot.errors.MisconfigurationError: nginx restart failed:  
b’’  
b’’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/usr/lib/python3/dist-packages/certbot/error\_handler.py”, line 108, in \_call\_registered  
self.funcs-1  
File “/usr/lib/python3/dist-packages/certbot/client.py”, line 626, in \_rollback\_and\_restart  
self.installer.restart()  
File “/usr/lib/python3/dist-packages/certbot\_nginx/configurator.py”, line 881, in restart  
nginx\_restart(self.conf(‘ctl’), self.nginx\_conf)  
File “/usr/lib/python3/dist-packages/certbot\_nginx/configurator.py”, line 1141, in nginx\_restart  
“nginx restart failed:\n%s\n%s” % (out.read(), err.read()))  
certbot.errors.MisconfigurationError: nginx restart failed:  
b’’  
b’’  
nginx restart failed:  
b’’  
b’’

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

The operating system my web server runs on is (include version):  
Distributor ID: Debian  
Description: Debian GNU/Linux 10 (buster)  
Release: 10  
Codename: buster

My hosting provider, if applicable, is:

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

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

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [August 28, 2019, 3:56pm UTC](https://community.letsencrypt.org/t/failure-automatic-setting-redirect-http-traffic-to-https/100865/2 "2019-08-28T15:56:11Z")

</div>

Hi @rom323

> [@rom323](#):
>
> nginx: [emerg] a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/default:22

there is your errror. You have multiple default server definitions.

Merge these different vHosts in one vHost.

What says

```nohighlight
nginx -T

```

PS: Oh, checked your domain - most looks good - [https://check-your-website.server-daten.de/?q=dev01.intsercom.cl](https://check-your-website.server-daten.de/?q=dev01.intsercom.cl)

Thought your server crashed. But your server is running:

| Domainname | Http-Status | redirect | Sec. | G |
| --- | --- | --- | --- | --- |
| • [http://dev01.intsercom.cl/](http://dev01.intsercom.cl/) | | | | |
| 200.27.222.43 | 200 | | 1.063 | H |
| | | | | |
| • [https://dev01.intsercom.cl/](https://dev01.intsercom.cl/) | | | | |
| 200.27.222.43 | 200 | | 5.373 | B |

Only the redirect is missing. The certificate is new, created today.

---

<div class="post-metadata">

**Author:** ![rom323](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rom323](https://community.letsencrypt.org/u/rom323)\
**Post date:** [August 28, 2019, 6:17pm UTC](https://community.letsencrypt.org/t/failure-automatic-setting-redirect-http-traffic-to-https/100865/3 "2019-08-28T18:17:05Z")

</div>

Hi JuergenAuer,

You were absolutely right. Thanks a lot for your help!.👌

---

<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:** [September 27, 2019, 6:17pm UTC](https://community.letsencrypt.org/t/failure-automatic-setting-redirect-http-traffic-to-https/100865/4 "2019-09-27T18:17:09Z")

</div>

Closed on September 27, 2019, 6:17pm UTC

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