Skip to content

Update force-ssl.conf to allow for letsencrypt directories over http #2038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

the1ts
Copy link
Contributor

@the1ts the1ts commented May 4, 2022

Since we have moved force-ssl.conf into the server section, it overrides the location based letsencrypt allowed over http

Since we have moved force-ssl.conf into the server section, it overrides the location based letsencrypt allowed over http

- Make force-ssl only work if both http traffic and outside the letsencrypt directories.
@jc21
Copy link
Member

jc21 commented May 4, 2022

This is an automated message from CI:

Docker Image for build 1 is available on DockerHub as jc21/nginx-proxy-manager:github-pr-2038

Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.

@the1ts
Copy link
Contributor Author

the1ts commented May 5, 2022

Not the best candidate to test this since I'm using a DNS based wildcard so letsencrypt not hitting Nginx. However, I'm not seeing issues for http->https on my domains. And curl to the /.well-known/acme-challenge/1234 gives the expected 404 rather than 301 redirect and I have made no changes so have both old and new style config with force-ssl.conf in both server section and location / section.

@the1ts
Copy link
Contributor Author

the1ts commented Jun 3, 2022

Just a bump, we are blocking renews.

@arsors
Copy link

arsors commented Jul 11, 2022

Another bump. I have the same problem and have to manually unforce ssl and then renew the ssl certificate.

@the1ts
Copy link
Contributor Author

the1ts commented Jul 22, 2022

@jc21 I appreciate you're looking hard at 3.0, but please take a look at this pr, this is blocking renewals of newly created proxies (from those made after the force_ssl.conf move to server section) which isn't a good look for us to have in the version 2 branch.

@tfmm
Copy link
Contributor

tfmm commented Sep 7, 2022

Bumping this, renewals are still broken as far as I can tell.

@maltokyo
Copy link

maltokyo commented Oct 3, 2022

Bump, why is this not priority, I can only assume that nobody maintains this anymore

@the1ts
Copy link
Contributor Author

the1ts commented Oct 4, 2022

@maltokyo all I would ask is if you can move to using the docker image mentioned in comment 2 here. That has the fix and it would be good to see some confirmation here. You must remember to move back to :latest when this project starts moving again so you don't get stuck on an old version.

@maltokyo
Copy link

maltokyo commented Oct 4, 2022

Thank you @the1ts - I am on the latest version, so hesitate to move back to a version from May. Can I apply the fix myself, build and test this way?

@the1ts
Copy link
Contributor Author

the1ts commented Oct 4, 2022

@maltokyo latest is from March, so older than the fixed one in this PR.

@maltokyo
Copy link

maltokyo commented Oct 4, 2022

Ah apologies! Will try this, thank you @the1ts

@maltokyo
Copy link

maltokyo commented Oct 5, 2022

@the1ts do I need to worry about the warning: "Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes"

I dont see db changes in this PR itself, but just wanted to check. Backing up will take some time for me.

@the1ts
Copy link
Contributor Author

the1ts commented Oct 5, 2022

@maltokyo the only changes are to nginx file creation not DB. So change the docker tag and try and get npm to make a change to the nginx files by perhaps turning off and on the force SSL. Then renewal should be back working next time it's needed.

@maltokyo
Copy link

maltokyo commented Oct 5, 2022

ok, running it now, will leave for some time and see what happens. Unfortunately, next renewals are on 1st Jan, so might need to wait.

@EDIflyer
Copy link

EDIflyer commented Oct 7, 2022

@the1ts @jc21 OK I tried the version in jc21/nginx-proxy-manager:github-pr-2038 and confirm it correctly allows manual renewal via the UI (/nginx/certificates page) for proxies that have 'Force SSL' enabled.

(I did have an issue at first where I was getting an internal error but clearing the certbot lock files as per this post did the trick!)

@EDIflyer
Copy link

EDIflyer commented Nov 8, 2022

Great to see a new release out but would be great if this PR could be merged in so I could pick up those updates too :)

@Schlumpf9
Copy link

Schlumpf9 commented Nov 11, 2022

It's really a pain right now to manually renew all certificates that have "force ssl" enabled. That's a key function of nginx proxy manager and I am considering to unuse it just because of that bug... I have 15 domains and to update all manually is a real pain! That bug is existing since a year @jc21

@fdzaebel
Copy link

As a fix seems to be available now...when will this be added to the official release?

Thank you very much. :)

@maltokyo
Copy link

ok, running it now, will leave for some time and see what happens. Unfortunately, next renewals are on 1st Jan, so might need to wait.

@the1ts - I have been running the version specified as above, and my certificates expire on Jan 1st 2023, and have NOT been auto-updated while running this version. They should have been by now, correct? If that is the case, I suppose this fix is not working out.

@the1ts
Copy link
Contributor Author

the1ts commented Dec 27, 2022

Sorry @maltokyo I don't use NPM anymore as its not really been supported for most of a year, but I would check out issue #918 others have seen issues with lock files being left behind that stop certbot from actually running even after this fix for force ssl. You can force an update in the UI and look at both certbot logs and NPM for more info.

@Whoopsadaisy
Copy link

IMHO the regexp in the commit needs additional escaping:

- if ($request_uri !~ "^/.well-known/acme-challenge/(.*)") {
+ if ($request_uri !~ "^/\.well-known/acme-challenge/(.*)") {

Also an alternative implementation of force-ssl.conf could be:

set $url "${scheme}:${request_uri}";
if ($url ~ "^http:(?!/\.well-known/acme-challenge/(.*))") {
        return 301 https://$host$request_uri;
}

@maltokyo
Copy link

thanks @the1ts - what do you use now? maybe time to switch, cant be chasing basic stuff like this for months and months.

@nginxproxymanagerci
Copy link

Docker Image for build 7 is available on DockerHub as jc21/nginx-proxy-manager:github-pr-2038

Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.

@EDIflyer
Copy link

Any chance this PR could be rebased onto the current version?

@sanderlv
Copy link

sanderlv commented Apr 1, 2023

Sorry, but I need to say my enthusiasm for NPM...

@KaeTuuN
Copy link

KaeTuuN commented Dec 11, 2023

Bump! Still an issue in 2.10.4!
@jc21 PLEASE MERGE THIS PR!

Forget it... Merge #3121

@sunsreddit
Copy link

+1, please merge #3121 @jc21

1 similar comment
@dergreg
Copy link

dergreg commented Aug 1, 2024

+1, please merge #3121 @jc21

@maltokyo
Copy link

maltokyo commented Aug 5, 2024

I switched, to linuxserver/swag - have not looked back. The fact that this basic stuff does not get fixed/merged was too much.

Copy link

github-actions bot commented Apr 2, 2025

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

@github-actions github-actions bot added the stale label Apr 2, 2025
@sanderlv
Copy link

sanderlv commented Apr 2, 2025

Comment to keep it op.

@EDIflyer
Copy link

EDIflyer commented Apr 2, 2025

@github-actions PR #3121 still needs merged to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal error on SSL certificates when force SSL is active
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy