Let's Encrypt Certificate improvements
Guru Member
So this is great to see and hope to see in switches but I would like a custom change to the way HTTP works as I have Nginx which can do the redirect of like zyxel-router1.ddns.net (soon to be change to zyxel-router1.bridgemode.network) without affecting like server.bridgemode.network
All thats needed is for the FLEX H to listen on a LAN interface for port 80 and Nginx can proxy on WAN to the internal LAN but for security on another port then 80 only when renew happens so what happens is the renew starts USG listens port 88 traffic port 80 is sent to Nginx then Nginx proxy to port 88 to USG and the challenge is complete port 88 no longer listened on.
Comments
-
Hi @PeterUK,
You cannot NAT the 88 port to 80?
0 -
I don't think you understand how Nginx works or what it is maybe?
so its like this I run a PC server it has a web server on port 443 for HTTPS and port 8080 for HTTP I also have a DNS-over-HTTPS with a Let's Encrypt then have nginx on where the web server is thats on port 80 the config (the important bits) is like this:
}
server {
listen 80;
server_name server.bridgemode.network;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80;
server_name dns.bridgemode.network;
location / {
proxy_pass http://192.168.138.13:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}So anything server.bridgemode.network goes to the web server on port 8080 and anything dns.bridgemode.network goes to the DNS-over-HTTPS server when certbot does setup or renew incoming traffic to port 80 that how the Certificate challenge is done will be for dns.bridgemode.network
as Nginx is a proxy traffic will be like this
source IP > WAN IP:80 >Nginx> 192.168.138.2 > 192.168.138.13:80 to DNS-over-HTTPS server when it opens port 80 for challenge
so what I would do is add to the above setup like
server {
listen 80;
server_name zyxel-router1.bridgemode.network;
location / {
proxy_pass http://192.168.138.100:88;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;so
source IP > WAN IP:80 >Nginx> 192.168.138.2 > 192.168.138.100:88 to USG
the reason to change port to like 88 is the UI thats on 80 for the USG I don't think the Certificate challenge will know that Nginx changed the port as returning traffic will come from source 80 by Nginx.
0 -
Hi @PeterUK,
Thanks for the detailed information!
Regarding your request, we would like to clarify two points:
- The HTTP-01 challenge validation must occur on port 80. This is a requirement of the ACME standard itself (not specific to our implementation), so we're unable to offer a configurable port for the challenge listener.
- About port 80 being persistently exposed, please rest assure that the USG FLEX H does not keep port 80 open at all times. It's automatically opened only for the short window needed to complete the Let's Encrypt renewal (typically just a couple of minutes), and is closed again automatically once validation is complete. Therefore, there is no long-term exposure issue to address, and no workaround is required.
We appreciate your understanding.
Zyxel Tina
0 -
Hi Tina
Yes I get it needs port 80 but do you understand how how Nginx works?
https://nginx.org/I did a test of my method and it works HTTP-01 challenge validation will not know port 80 was changed the challenge comes in on port 80 to Nginx then proxy by port 88 then USG maps it back to 80 to my linux mint that did the challenge but really it should work without mapping from 88 to 80?
I think there can be security issue with port 80 to FLEX H even if you don't know it yet unless you have coded for when port 80 is waiting for the challenge you block UI access for port 80 which is why I would like the port to be changeable so that Nginx can proxy the given domain from port 80 to another port on the USG for the challenge to be done.
as another side question is the HTTP-01 challenge only on External or can it work on General or Internal if proxyed to the gateway
Nginx would allow port 80 to be open without downtime when doing the challenge
server {
listen 80;
server_name dns.bridgemode.network;
location / {
proxy_pass http://192.168.138.13:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}}
server {
listen 80;
server_name home-assistant.bridgemode.network;
location / {
proxy_pass http://192.168.138.12:88;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80;
server_name hub5.bridgemode.network;
location / {
proxy_pass http://192.168.138.12:88;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}so like I have a dns.bridgemode.network on linux mint DoH Server Certificate that the challenge only does for the given subdomain by Let's Encrypt
.And home-assistant.bridgemode.network and hub5.bridgemode.network that the proxy to 192.168.138.12 port 88 to FLEX 700H Secondary IP where I do
and get a Certificate there for them subdomain by Let's Encrypt to it Nginx config
so what I would like is a just a optional port change that can close itself when its do and is only for the challenge on what interface please it really will work and Nginx takes case of the inbound port 80 handing.
0 -
0
-
And also using Nginx in this way solves completely the how do we Certificate for many devices that only has one WAN IP for port 80 like other USG, switches and AP's
0
Categories
- All Categories
- 442 Beta Program
- 3.1K Nebula
- 235 Nebula Ideas
- 6.7K Security
- 732 USG FLEX H Series
- 374 Security Ideas
- 1.8K Switch
- 87 Switch Ideas
- 1.5K Wireless
- 57 Wireless Ideas
- 7.1K Consumer Product
- 319 Service & License
- 511 News and Release
- 99 Security Advisories
- 31 Education Center
- 10 [Campaign] Zyxel Network Detective
- 5.2K FAQ
- 34 Documents
- 89 About Community
- 117 Security Highlight
Master Member
Zyxel Employee

