[GH-ISSUE #2418] Internal error on renewing SSL certificate when all requests of proxy host are redirected #1697

Closed
opened 2026-02-26 07:32:05 +03:00 by kerem · 8 comments
Owner

Originally created by @davhae on GitHub (Nov 22, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2418

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • No
  • 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 using the Advanced NGINX Configuration of a proxy host to redirect all requests, renewal of certificates returns an internal error.

The configuration may look like this:

rewrite ^(/.*)$ https://another-domain.com/ permanent;

Nginx Proxy Manager Version
v2.9.18

Expected behavior
I don't really know if it is expected, but requests to .well-known should be handled by the reverse proxy.

Operating System
Ubuntu Jammy

Originally created by @davhae on GitHub (Nov 22, 2022). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2418 **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - No - 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 using the Advanced NGINX Configuration of a proxy host to redirect all requests, renewal of certificates returns an internal error. The configuration may look like this: ``` rewrite ^(/.*)$ https://another-domain.com/ permanent; ``` **Nginx Proxy Manager Version** v2.9.18 **Expected behavior** I don't really know if it is expected, but requests to .well-known should be handled by the reverse proxy. **Operating System** Ubuntu Jammy
kerem 2026-02-26 07:32:05 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@the1ts commented on GitHub (Nov 23, 2022):

Just asking, but does the problem domain have force-ssl enabled? There is a bug with this config, remove the force-ssl, manually renew and turn back on until the fixed is merged and released. The bug is because the current config forces the redirect to https before letsencrypt exception is processed so letsencrypt fails since it doesn't work over https. So check if its this bug or your rewrite that is causing the letsencrypt breakage.

<!-- gh-comment-id:1325457323 --> @the1ts commented on GitHub (Nov 23, 2022): Just asking, but does the problem domain have force-ssl enabled? There is a bug with this config, remove the force-ssl, manually renew and turn back on until the fixed is merged and released. The bug is because the current config forces the redirect to https before letsencrypt exception is processed so letsencrypt fails since it doesn't work over https. So check if its this bug or your rewrite that is causing the letsencrypt breakage.
Author
Owner

@gnilebein commented on GitHub (Dec 12, 2022):

Just asking, but does the problem domain have force-ssl enabled? There is a bug with this config, remove the force-ssl, manually renew and turn back on until the fixed is merged and released. The bug is because the current config forces the redirect to https before letsencrypt exception is processed so letsencrypt fails since it doesn't work over https. So check if its this bug or your rewrite that is causing the letsencrypt breakage.

Is there an issue about the bug that I can subscribe to in order to get an info when it is fixed? I could not find one with the search.

<!-- gh-comment-id:1346245264 --> @gnilebein commented on GitHub (Dec 12, 2022): > Just asking, but does the problem domain have force-ssl enabled? There is a bug with this config, remove the force-ssl, manually renew and turn back on until the fixed is merged and released. The bug is because the current config forces the redirect to https before letsencrypt exception is processed so letsencrypt fails since it doesn't work over https. So check if its this bug or your rewrite that is causing the letsencrypt breakage. Is there an issue about the bug that I can subscribe to in order to get an info when it is fixed? I could not find one with the search.
Author
Owner

@davhae commented on GitHub (Dec 12, 2022):

Disabling force-ssl for the only Redirection-Host using the certificate does not make it renewable.
On the other hand, temporarily removing the rewrite while force-ssl is activate results in a successful renew.

<!-- gh-comment-id:1346908907 --> @davhae commented on GitHub (Dec 12, 2022): Disabling force-ssl for the only Redirection-Host using the certificate does not make it renewable. On the other hand, temporarily removing the rewrite while force-ssl is activate results in a successful renew.
Author
Owner

@gnilebein commented on GitHub (Dec 12, 2022):

Disabling force-ssl for the only Redirection-Host using the certificate does not make it renewable. On the other hand, temporarily removing the rewrite while force-ssl is activate results in a successful renew.

There is an fix for the issue... Just need to be merged... i added the change to my docker container (FIX: https://github.com/NginxProxyManager/nginx-proxy-manager/pull/2038)

<!-- gh-comment-id:1347140918 --> @gnilebein commented on GitHub (Dec 12, 2022): > Disabling force-ssl for the only Redirection-Host using the certificate does not make it renewable. On the other hand, temporarily removing the rewrite while force-ssl is activate results in a successful renew. There is an fix for the issue... Just need to be merged... i added the change to my docker container (FIX: https://github.com/NginxProxyManager/nginx-proxy-manager/pull/2038)
Author
Owner

@davhae commented on GitHub (Dec 13, 2022):

Disabling force-ssl for the only Redirection-Host using the certificate does not make it renewable. On the other hand, temporarily removing the rewrite while force-ssl is activate results in a successful renew.

There is an fix for the issue... Just need to be merged... i added the change to my docker container (FIX: #2038)

Like i said it has nothing to do with force-ssl

<!-- gh-comment-id:1347948574 --> @davhae commented on GitHub (Dec 13, 2022): > > Disabling force-ssl for the only Redirection-Host using the certificate does not make it renewable. On the other hand, temporarily removing the rewrite while force-ssl is activate results in a successful renew. > > There is an fix for the issue... Just need to be merged... i added the change to my docker container (FIX: #2038) Like i said it has nothing to do with force-ssl
Author
Owner

@evelynhathaway commented on GitHub (Dec 26, 2022):

@davhae Maybe the issue is that rewrite redirects before the NPM has a chance to respond to Let's Encrypt. What if you try wrapping your rewrite in a location block?

Custom Nginx Configuration - Redirects ACME challenge (Before)

rewrite ^(/.*)$ https://another-domain.com/ permanent;

Custom Nginx Configuration - Responds to ACME challenge (After)

location / {
  rewrite ^(/.*)$ https://another-domain.com/ permanent;
}
<!-- gh-comment-id:1365449507 --> @evelynhathaway commented on GitHub (Dec 26, 2022): @davhae Maybe the issue is that `rewrite` redirects before the NPM has a chance to respond to Let's Encrypt. What if you try wrapping your `rewrite` in a `location` block? **Custom Nginx Configuration - Redirects ACME challenge (Before)** ```nginx rewrite ^(/.*)$ https://another-domain.com/ permanent; ``` **Custom Nginx Configuration - Responds to ACME challenge (After)** ```nginx location / { rewrite ^(/.*)$ https://another-domain.com/ permanent; } ```
Author
Owner

@github-actions[bot] commented on GitHub (Feb 4, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:1925539695 --> @github-actions[bot] commented on GitHub (Feb 4, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (Mar 21, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2742069639 --> @github-actions[bot] commented on GitHub (Mar 21, 2025): Issue was closed due to inactivity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
starred/nginx-proxy-manager-NginxProxyManager#1697
No description provided.