NginxProxyManager / NginxProxyManager/nginx-proxy-manager

When adding a new (http:80) proxy I get a SSL error in the log

Open
#2,081 11 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug stale
Dominant language
TypeScript
Stars
34.2k
Forks
3.9k
Avg merge
21h 12m
Merged PRs (30d)
20

Description

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug
When I add a new proxy, without SSL, I get the following error in my docker console output:

today at 08:51:44[5/30/2022] [8:51:44 AM] [Express  ] › ⚠  warning   Command failed: /usr/sbin/nginx -t -g "error_log off;"
today at 08:51:44nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/npm-1/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/npm-1/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
today at 08:51:44nginx: configuration file /etc/nginx/nginx.conf test failed

The fact that NPM can't find the fullchain.pem in the given folder (and the folder) is correct since this certificate isn't available anymore. I've deleted that certificate yesterday using the NPM GUI.

Nginx Proxy Manager Version
v2.9.18

To Reproduce
Steps I did before:

  1. Create a LE-certificate (wildcard)
  2. Add proxies
  3. Create a new LE-certificate (wildcard) with a new DNS provider
  4. Change the existing certificates for the proxies already created
  5. Delete the certificate from step 1

The result is that I now have /etc/letsencrypt/live/npm-2/* and /etc/letsencrypt/live/npm-1/ isn't on disk anymore

Steps to reproduce the behavior:

  1. Login to NPM
  2. Go tho Hosts
  3. Press Add Proxy Host
  4. Enter domain name
  5. Fill in the IP + port
  6. Press save
  7. On screen I get an Internal Error warning:
image

And on the docker CLI I get the error:

today at 09:04:55[5/30/2022] [9:04:55 AM] [Express  ] › ⚠  warning   Command failed: /usr/sbin/nginx -t -g "error_log off;"
today at 09:04:55nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/npm-1/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/npm-1/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
today at 09:04:55nginx: configuration file /etc/nginx/nginx.conf test failed
today at 09:04:55

Expected behavior
I would expect that NPM created the proxy without any issues

Operating System

  • Synology NAS with the latest Docker software
  • Browser: Safari 15.5

Additional context
I'm using NPM in combination with SQLite.

A little addition... I just thought about restarting the container, when I do that I get the following in the logs:

today at 09:09:41❯ Enabling IPV6 in hosts: /etc/nginx/conf.d
today at 09:09:41  ❯ /etc/nginx/conf.d/include/assets.conf
today at 09:09:41  ❯ /etc/nginx/conf.d/include/block-exploits.conf
today at 09:09:41  ❯ /etc/nginx/conf.d/include/force-ssl.conf
today at 09:09:41  ❯ /etc/nginx/conf.d/include/ip_ranges.conf
today at 09:09:41  ❯ /etc/nginx/conf.d/include/letsencrypt-acme-challenge.conf
today at 09:09:41  ❯ /etc/nginx/conf.d/include/proxy.conf
today at 09:09:41  ❯ /etc/nginx/conf.d/include/ssl-ciphers.conf
today at 09:09:41  ❯ /etc/nginx/conf.d/include/resolvers.conf
today at 09:09:41  ❯ /etc/nginx/conf.d/default.conf
today at 09:09:41  ❯ /etc/nginx/conf.d/production.conf
today at 09:09:41❯ Enabling IPV6 in hosts: /data/nginx
today at 09:09:41  ❯ /data/nginx/default_host/site.conf
today at 09:09:41  ❯ /data/nginx/proxy_host/8.conf
today at 09:09:41  ❯ /data/nginx/proxy_host/4.conf
today at 09:09:41  ❯ /data/nginx/proxy_host/9.conf
today at 09:09:41  ❯ /data/nginx/proxy_host/6.conf
today at 09:09:41  ❯ /data/nginx/proxy_host/3.conf
today at 09:09:41  ❯ /data/nginx/proxy_host/5.conf
today at 09:09:41  ❯ /data/nginx/proxy_host/2.conf
today at 09:09:41  ❯ /data/nginx/redirection_host/1.conf
today at 09:09:41nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/npm-1/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/npm-1/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the generated files under /data/nginx/proxy_host/ and the certificate references under /etc/letsencrypt/live/, then run nginx -t to reproduce the failure. Trace the save path for a new proxy after a certificate is deleted; done means stale certificate references no longer prevent creating an HTTP-only proxy.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, nginx, typescript
Domain
backend, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.