tried to insert directive "[['if', '($host', '=', 'private.yt.lemnoslife.com)'], [['return', '301', 'https://$host$request_uri']]]" but found conflicting #1

Closed
opened 2024-04-01 00:07:37 +02:00 by Benjamin_Loison · 1 comment
certbot --nginx --key-type ecdsa --elliptic-curve secp384r1 -d private.yt.lemnoslife.com,yt4.lemnoslife.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Certificate not yet due for renewal

You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.
(ref: /etc/letsencrypt/renewal/private.yt.lemnoslife.com.conf)

What would you like to do?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Attempt to reinstall this existing certificate
2: Renew & replace the certificate (may be subject to CA rate limits)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Renewing an existing certificate for private.yt.lemnoslife.com and yt4.lemnoslife.com

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/private.yt.lemnoslife.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/private.yt.lemnoslife.com/privkey.pem
This certificate expires on 2024-06-29.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for private.yt.lemnoslife.com to /etc/nginx/sites-enabled/peertube
Successfully deployed certificate for yt4.lemnoslife.com to /etc/nginx/sites-enabled/peertube
Unable to set the redirect enhancement for private.yt.lemnoslife.com.

NEXT STEPS:
- The certificate was saved, but could not be installed (installer: nginx). After fixing the error shown below, try installing it again by running:
  certbot install --cert-name private.yt.lemnoslife.com

Problem in /etc/nginx/sites-enabled/peertube: tried to insert directive "[['if', '($host', '=', 'private.yt.lemnoslife.com)'], [['return', '301', 'https://$host$request_uri']]]" but found conflicting "[['if', '($host', '=', 'private.yt.lemnoslife.com)'], [['return', '301', '"https://$host$request_uri"']]]".
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

Related to Benjamin_Loison/git/issues/21.

```bash certbot --nginx --key-type ecdsa --elliptic-curve secp384r1 -d private.yt.lemnoslife.com,yt4.lemnoslife.com ``` ``` Saving debug log to /var/log/letsencrypt/letsencrypt.log Certificate not yet due for renewal You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry. (ref: /etc/letsencrypt/renewal/private.yt.lemnoslife.com.conf) What would you like to do? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: Attempt to reinstall this existing certificate 2: Renew & replace the certificate (may be subject to CA rate limits) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2 Renewing an existing certificate for private.yt.lemnoslife.com and yt4.lemnoslife.com Successfully received certificate. Certificate is saved at: /etc/letsencrypt/live/private.yt.lemnoslife.com/fullchain.pem Key is saved at: /etc/letsencrypt/live/private.yt.lemnoslife.com/privkey.pem This certificate expires on 2024-06-29. These files will be updated when the certificate renews. Certbot has set up a scheduled task to automatically renew this certificate in the background. Deploying certificate Successfully deployed certificate for private.yt.lemnoslife.com to /etc/nginx/sites-enabled/peertube Successfully deployed certificate for yt4.lemnoslife.com to /etc/nginx/sites-enabled/peertube Unable to set the redirect enhancement for private.yt.lemnoslife.com. NEXT STEPS: - The certificate was saved, but could not be installed (installer: nginx). After fixing the error shown below, try installing it again by running: certbot install --cert-name private.yt.lemnoslife.com Problem in /etc/nginx/sites-enabled/peertube: tried to insert directive "[['if', '($host', '=', 'private.yt.lemnoslife.com)'], [['return', '301', 'https://$host$request_uri']]]" but found conflicting "[['if', '($host', '=', 'private.yt.lemnoslife.com)'], [['return', '301', '"https://$host$request_uri"']]]". Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details. ``` Related to [Benjamin_Loison/git/issues/21](https://codeberg.org/Benjamin_Loison/git/issues/21).
Author
Owner

I just commented with #:

if ($host = private.yt.lemnoslife.com) {
    return 301 "https://$host$request_uri";
} # managed by Certbot

and it adds:

if ($host = private.yt.lemnoslife.com) {
    return 301 https://$host$request_uri;
} # managed by Certbot

Have not had this issue before, was it because of nginx-formatter?

I just commented with `#`: ``` if ($host = private.yt.lemnoslife.com) { return 301 "https://$host$request_uri"; } # managed by Certbot ``` and it adds: ``` if ($host = private.yt.lemnoslife.com) { return 301 https://$host$request_uri; } # managed by Certbot ``` Have not had this issue before, was it because of [nginx-formatter](https://github.com/soulteary/nginx-formatter)?
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Benjamin_Loison/certbot#1
No description provided.