Certbot renew failing on certbot: error: Unexpected line 19 in /usr/local/nginx/conf/nginx.conf: '"$upstream_cache_status"'

My domain is: www.trueniu.com

I ran this command: certbot-auto renew -c /usr/local/nginx/conf/nginx.conf

It produced this output:
certbot-auto [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] …

Certbot can obtain and install HTTPS/TLS/SSL certificates. By default,
it will attempt to use a webserver both for obtaining and installing the
certbot: error: Unexpected line 19 in /usr/local/nginx/conf/nginx.conf: ‘"$upstream_cache_status"’;

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

The operating system my web server runs on is (include version): CentOS release 6.5 (Final)

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.33.1

Hi @ricky.wang

-c must be a Certbot config file:

Looks like you use a nginx config file.

1 Like

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