# IP Location + Let's encrypt renewal

**URL:** <https://community.ipfire.org/t/ip-location-lets-encrypt-renewal/13204>\
**Category:** Security\
**Created:** [19 November 2024 08:24 UTC](https://community.ipfire.org/t/ip-location-lets-encrypt-renewal/13204 "2024-11-19T08:24:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cracksilver78](https://community.ipfire.org/user_avatar/community.ipfire.org/cracksilver78/32/12772_2.png) [@cracksilver78](https://community.ipfire.org/u/cracksilver78)\
**Post date:** [19 November 2024 08:24 UTC](https://community.ipfire.org/t/ip-location-lets-encrypt-renewal/13204/1 "2024-11-19T08:24:38Z")

</div>

Hi  
I run NGINX Proxy Manager on my Proxmox Server to route to the different services on the server.

Yeasterday we tried to renew manually different certificate from Let’s encrypt. It failed at all untill we deactivated Location Filter.

So after my research about this problem I see I’m not allone. This is a proble to any of us IPFire users.

So do we really only have this 2 options?

with opening whole usa in Location filter:

> [@Exception for acme.sh in location based filter](https://community.ipfire.org/t/exception-for-acme-sh-in-location-based-filter/8128):
>
> I guess my restrictive settings in mask Location based Filter prevented the acme.sh script to automatically renew my domain certificates. As a workaround i manually forced renewal after disabling the Location based Filter. I do not know the origin of the validation servers (i guess US with a .org domain) but anyway i would prefer to insert an exception rule only for these servers instead of disabling the whole US within the location based filter. How do i extract the needed servers to create …

or very complicate with cronjob and special firewall rules:

> [@Let's Encrypt - Location filter and firewall rule (command)](https://community.ipfire.org/t/lets-encrypt-location-filter-and-firewall-rule-command/4721):
>
> Hello all, I have a question regarding the “Location Filter” and firewall rule. I have a VM running on my router that hosts NextCloud. For NextCloud I have manually renewed the certificate from Let’s Encrypt every 3 months. Now I want to automate this and use the “acme.sh” which does this by itself. But now I have activated the Location FIlter on my router and only Germany is allowed, and I have deactivated the incoming port 80. When I had always manually extended the certificate, I activate…

thx.

---

<div class="post-metadata">

**Author:** ![bonnietwin](https://community.ipfire.org/user_avatar/community.ipfire.org/bonnietwin/32/12350_2.png) [@bonnietwin](https://community.ipfire.org/u/bonnietwin)\
**Post date:** [19 November 2024 08:37 UTC](https://community.ipfire.org/t/ip-location-lets-encrypt-renewal/13204/2 "2024-11-19T08:37:38Z")

</div>

> [@cracksilver78](#):
>
> with opening whole usa in Location filter:

That is likely to not be good enough because LetsEncrypt are using locations around the world and they have said that they will move to using multiple locations from multiple areas for an update and they will not provide any list of the servers they use.

So the two options are all I can think of and option 1 will likely need to be more open than just USA as they now use servers from all over the world and the ones they use are not restricted to the location you are in.

EDIT:  
Actually there is a third option which is what LetsEncrypt recommend when you have corporate requirements to only open up ports to defined IP’s and that is to use the DNS-01 Challenge instead of the HTTP-01 Challenge.  
[https://letsencrypt.org/docs/challenge-types/](https://letsencrypt.org/docs/challenge-types/)

or LetsEncrypt have also suggested to have a separate server specifically for certificate validation and place it in the DMZ and then extract the updated certs from the DMZ machine if they change.

---

<div class="post-metadata">

**Author:** ![nickh](https://community.ipfire.org/user_avatar/community.ipfire.org/nickh/32/9845_2.png) [@nickh](https://community.ipfire.org/u/nickh)\
**Post date:** [19 November 2024 09:17 UTC](https://community.ipfire.org/t/ip-location-lets-encrypt-renewal/13204/3 "2024-11-19T09:17:26Z")

</div>

Or, perhaps, hack the renewal script to insert an extra firewall rule to open port 80 to everywhere when it starts and delete it at the end?

---

<div class="post-metadata">

**Author:** ![cracksilver78](https://community.ipfire.org/user_avatar/community.ipfire.org/cracksilver78/32/12772_2.png) [@cracksilver78](https://community.ipfire.org/u/cracksilver78)\
**Post date:** [19 November 2024 09:24 UTC](https://community.ipfire.org/t/ip-location-lets-encrypt-renewal/13204/5 "2024-11-19T09:24:35Z")

</div>

yes I have to check that. I don’t know really how and when NGINX Proxy Manager does the renewal script.

---

<div class="post-metadata">

**Author:** ![cracksilver78](https://community.ipfire.org/user_avatar/community.ipfire.org/cracksilver78/32/12772_2.png) [@cracksilver78](https://community.ipfire.org/u/cracksilver78)\
**Post date:** [19 November 2024 09:25 UTC](https://community.ipfire.org/t/ip-location-lets-encrypt-renewal/13204/6 "2024-11-19T09:25:07Z")

</div>

Ok thx adolf

It sounds interesting with DNS-01 Challenge. But then we have another security risk in Keeping API credentials on webserver.

So I prefer to go with option 2: Firewall rules and cronjob

I think first I have to know when NGINX Proxy Manager starts the renewal for the Let’s encrypt. Later I can construct some rules here.

---

<div class="post-metadata">

**Author:** ![bbitsch](https://community.ipfire.org/user_avatar/community.ipfire.org/bbitsch/32/7420_2.png) [@bbitsch](https://community.ipfire.org/u/bbitsch)\
**Post date:** [19 November 2024 09:48 UTC](https://community.ipfire.org/t/ip-location-lets-encrypt-renewal/13204/7 "2024-11-19T09:48:44Z")

</div>

BTW Location Block is a IPFire side project. Discussion is also on the [Location maling list](https://lists.ipfire.org/mailman/listinfo/location).  
See also [Blog article](https://www.ipfire.org/blog/a-new-location-database-for-the-internet)
