π΄ μΈμ¦μ β μ§κΈ λ°λ‘ νμΈν΄ μ£ΌμΈμ
κ°±μ λ²νΌμ΄ μΈμ¦μ κ°μΈν€λ₯Ό μ§μ°κ³ μμμ΅λλ€
SSL μΈμ¦μ νλ©΄μμ κ°±μ (Renew) μ λλ₯΄λ©΄, NPGκ° λ°μ΄ν°λ² μ΄μ€μ 보κ΄νλ μΈμ¦μΒ·κ°μΈν€Β·λ°κΈμ 체μΈΒ·Let's Encrypt κ³μ μ 보λ₯Ό μ λΆ λΉμ λ²λ Έμ΅λλ€. κ°±μ μ΄ μ±κ³΅νλ©΄ μ κ°μΌλ‘ λ€μ μ±μμ‘μ§λ§, μ€ν¨νλ©΄ μνλ§ "λ°κΈλ¨"μΌλ‘ λλλ € λκ³ λ΄μ©μ λΉ μ±λ‘ λ¨μμ΅λλ€.
κ²μΌλ‘λ μ무 μΌλ μμ΄ λ³΄μ
λλ€. nginxλ μΈμ¦μλ₯Ό λ°μ΄ν°λ² μ΄μ€κ° μλλΌ λμ€ν¬μ νμΌμμ μ½κΈ° λλ¬Έμ, HTTPSλ κ·Έλλ‘ λμνκ³ nginx -tλ ν΅κ³Όν©λλ€. λ¬Έμ λ λ€μ΄λ‘λνκ±°λ, λ°±μ
μ λ€λ₯Έ μλ²μ 볡ꡬνκ±°λ, κ°±μ μ΄ νμν΄μ§ μμ μ λλ¬λ©λλ€.
κ°μ μ΄μ λ‘ "μΈμ¦μ μμ± ν μ¦μ λ€μ΄λ‘λκ° μ λλ€" λ μ¦μ(#253)λ λ°μνμ΅λλ€. λ°κΈ μ§νμλ μΊμμ κ°μΈν€κ° λΉ μ§ μ¬λ³Έμ΄ λ¨μ μμ΄μ λ€μ΄λ‘λκ° κ±°λΆλκ³ , 1λΆμ―€ μ§λ μΊμκ° λ§λ£λλ©΄ λ€μ λμ΅λλ€.
μ§μ μ
λ‘λν μΈμ¦μλ λ μ¬κ°νμ΅λλ€. μ μΈμ¦μ β μ
λ‘λλ‘ λ±λ‘ν μΈμ¦μλ v1.0.1 μ΄λ ν λ²λ ν€ λ΄μ©μ΄ μ μ₯λ μ μ΄ μμ΅λλ€. νμΌμ λμ€ν¬μ μ μμ μΌλ‘ μ μ₯λμ§λ§ λ°μ΄ν°λ² μ΄μ€ μͺ½μ νμ λΉμ΄ μμμ΅λλ€.
v2.45.0μμ μ΄λ κ² λ°λλλ€.
- μνλ§ λ°κΎΈλ μ μ₯κ³Ό ν€ λ΄μ©μ μ°λ μ μ₯μ λΆλ¦¬νμ΅λλ€. μ΄λ€ κ²½λ‘λ‘λ κΈ°μ‘΄ ν€λ₯Ό μ€μλ‘ μ§μΈ μ μμ΅λλ€.
- κ°μΈν€λ₯Ό λ΄μ μ μλ μΊμλ₯Ό μ κ±°νμ΅λλ€. λ°κΈ μ§ν λ€μ΄λ‘λκ° λ°λ‘ λ©λλ€.
- μ λ‘λν μΈμ¦μμ ν€κ° μ μμ μΌλ‘ μ μ₯λ©λλ€.
- μ΄λ―Έ λΉμ΄ λ²λ¦° νμ μλμΌλ‘ 볡ꡬλ©λλ€. λ€μ΄λ‘λλ₯Ό μλνλ©΄ λμ€ν¬μ
fullchain.pemΒ·privkey.pemμ λ€μ μ½μ΄ λ°μ΄ν°λ² μ΄μ€λ₯Ό μ±μ΄ λ€ νμΌμ λ΄λ € μ€λλ€.
μ κ·Έλ μ΄λ μ μ κ°±μ λ²νΌμ λλ₯΄μ§ λ§μΈμ. v2.13.18 ~ v2.44.0μ μ°κ³ κ³μ λ€λ©΄, μ§κΈ λλ₯΄λ κ°±μ μ΄ λ¨μ μλ ν€λ₯Ό μ§μλλ€. λ¨Όμ μ κ·Έλ μ΄λνμλ©΄ λ©λλ€.
μ κ·Έλ μ΄λ ν νμΈνμ€ κ² λ κ°μ§μ λλ€.
- μΈμ¦μ λͺ©λ‘μμ κ° μΈμ¦μλ₯Ό ν λ²μ© λ€μ΄λ‘λν΄ λ³΄μΈμ. μλ λ°κΈ μΈμ¦μλ λλΆλΆ μ΄ κ³Όμ μμ μ‘°μ©ν 볡ꡬλ©λλ€.
- κ·Έλλ "νμΌλ‘λ 볡ꡬν μ μμ΅λλ€" λΌλ μλ΄κ° λμ€λ μΈμ¦μλ λμ€ν¬ νμΌκΉμ§ μλ κ²½μ°μ λλ€. μλ λ°κΈμ΄λ©΄ κ°±μ (μ΄μ μμ ν©λλ€), μ§μ μ¬λ¦¬μ μΈμ¦μλ©΄ ν΄λΉ μΈμ¦μλ₯Ό μ΄μ΄ μμ (Update) μμ λ€μ μ λ‘λν΄ μ£ΌμΈμ. μ μΈμ¦μ μΆκ°λ λ³λ νλͺ©μ λ§λ€ λΏ μ΄ μΈμ¦μλ₯Ό κ³ μΉμ§ λͺ»ν©λλ€.
μ΄ κΈ°κ°μ λ°μ λμ λ°±μ μλ ν€κ° λΉμ΄ μμ μ μμ΅λλ€. λ€λ₯Έ μλ²μ 볡ꡬν κ³νμ΄ μμΌμλ©΄, μ κ·Έλ μ΄λνκ³ μ μ μ°¨λ‘ λ³΅κ΅¬ν λ€ λ°±μ μ λ€μ λ°μΌμκΈΈ κΆν©λλ€.
μ°Έκ³ : ν€κ° λΉλ©΄ Let's Encrypt κ³μ μ 보λ ν¨κ» λΉμμ‘κΈ° λλ¬Έμ, κ°±μ ν λλ§λ€ κ³μ μ μλ‘ λ±λ‘νμ΅λλ€. Let's Encryptλ IPλΉ 3μκ°μ 10κ°λ‘ μ κ· λ±λ‘μ μ ννλ―λ‘, κ°±μ μ λ°λ³΅νλ€ λ°κΈ μμ²΄κ° λ§ν μ μμμ΅λλ€. μ΄μ κ³μ μ 보λ λ³λλ‘ λ³΄κ΄λμ΄ μ¬μ¬μ©λ©λλ€.
μ λ³΄ν΄ μ£Όμ @heygoodluck λ κ°μ¬ν©λλ€. (#253)
ποΈ λ°±μ 볡ꡬ
μ§μ λ§λ μ°¨λ¨ κ·μΉμ΄ μμΌλ©΄ λ³΅κ΅¬κ° ν΅μ§Έλ‘ μ€ν¨νμ΅λλ€
Exploit μ°¨λ¨ κ·μΉμ νλλΌλ μ§μ λ§λμ ¨λ€λ©΄, κ·Έ λ°±μ μ 볡ꡬλμ§ μμμ΅λλ€. λ³΅κ΅¬κ° HTTP 500κ³Ό ν¨κ» λ°μ΄ν°λ² μ΄μ€ μ€λ₯λ₯Ό λ΄κ³ μ μ²΄κ° λ‘€λ°±λμ΅λλ€. λ΄μ₯ κ·μΉλ§ μλ λ°±μ μ μ μμ΄μκΈ° λλ¬Έμ, μ°λ μ¬λμ λ°λΌ λκΈ°λ νκ³ μ λκΈ°λ νμ΅λλ€.
μμΈμ μ‘΄μ¬νμ§ μλ μ μ½ μ‘°κ±΄μ μ°Έμ‘°νλ μ μ₯ ꡬ문μ΄μμ΅λλ€. μ€μΉ μμ μ΄λ μ κ·Έλ μ΄λ μ¬λΆμ 무κ΄νκ² μ²μλΆν° ν λ²λ λμν μ μ΄ μλ κ²½λ‘μ λλ€. μ΄μ μ μμ μΌλ‘ 볡ꡬλλ©°, κ°μ μ΄λ¦μ κ·μΉμ΄ μ¬λ¬ κ° μμ΄λ κ·Έλλ‘ μ΄μλ©λλ€.
λ€μΌλ‘, μ΅μ λ²μ μμ λ°μ λ°±μ μ ꡬ λ²μ μ 볡ꡬν λ λμ μ€μΉμ μλ λ΄μ₯ κ·μΉμ΄ λ€μ΄ μμΌλ©΄ μμ 볡ꡬ μ μ²΄κ° μ€ν¨νμ΅λλ€. μ΄μ κ·Έλ° κ·μΉκ³Ό κ·Έμ λΈλ¦° μμΈλ§ 건λλ°κ³ λλ¨Έμ§λ 볡ꡬλ©λλ€.
λ³΅κ΅¬κ° nginx κΈ°λ³Έ μΈμ¦μλ₯Ό 0λ°μ΄νΈλ‘ λ§λ€λ λ¬Έμ
λ°±μ
μ μΈμ¦μκ° ν¬ν¨λΌ μμΌλ©΄, λ³΅κ΅¬κ° nginxμ κΈ°λ³Έ μ체μλͺ
μΈμ¦μλ₯Ό λΉ νμΌλ‘ λ§λ€μ΄ νλ‘μ μ 체μ μ€μ κ²μ¬(nginx -t)λ₯Ό μ€ν¨μμΌ°μ΅λλ€. κ·Έ μνμμλ μ€μ μ λ€μ λΆλ¬μ¬ μ μμ΄, μ΄νμ λͺ¨λ λ³κ²½μ΄ λ°μλμ§ μμμ΅λλ€.
νμΌμ λ¨Όμ λΉμ°κ³ λμ κΆνμ μ€μ νλ μμμλλ°, κ·Έ κΆν μ€μ μ΄ μ€ν¨νλ©΄ λΉμ΄ μνλ‘ λλ λ²λ Έμ΅λλ€. API 컨ν μ΄λλ 보μμ μ΅μ κΆνμΌλ‘ λμνκΈ° λλ¬Έμ, nginx 컨ν μ΄λκ° λ§λ νμΌμ λν΄μλ μ΄ κΆν μ€μ μ΄ νμ μ€ν¨ν©λλ€.
μ΄μ 볡ꡬλ μμ νμΌμ λ¨Όμ κΈ°λ‘ν λ€ ν΅μ§Έλ‘ κ΅μ²΄ν©λλ€. μ΄λ€ μ€λ₯κ° λλλΌλ κΈ°μ‘΄ νμΌμ μμλμ§ μμ΅λλ€. κ°μΈν€λ₯Ό λ€λ₯Έ μ¬μ©μκ° μ½μ§ λͺ»νκ² νλ 보νΈλ κ·Έλλ‘μ΄λ©°, μ€νλ € λ΄μ©μ΄ κΈ°λ‘λκΈ° μ μ μ μ©λ©λλ€.
μ΄λ―Έ μ΄ λ¬Έμ λ₯Ό κ²ͺμΌμ κ²½μ° β μ€μ λ³κ²½μ΄ λ°μλμ§ μκ±°λ nginx -tκ° μΈμ¦μλ₯Ό λͺ» μ½λλ€κ³ νλ€λ©΄ β νλ‘μ 컨ν
μ΄λλ₯Ό ν λ² μ¬μμνλ©΄ κΈ°λ³Έ μΈμ¦μκ° λ€μ λ§λ€μ΄μ§λλ€.
docker compose restart nginxπ« IP μ°¨λ¨ κΈ°κ° β Fail2ban νλ©΄κΉμ§
μ§λ λ²μ μμ μ°¨λ¨ κΈ°κ° λͺ©λ‘μ νλλ‘ ν΅μΌνλ©΄μ Fail2ban μ€μ νλ©΄μ΄ λΉ μ Έ μμμ΅λλ€. μ μ μ²μ λ§μν΄ μ£Όμ νλ©΄μ΄ κ·Έμͺ½μ΄μλλ° λμ³€μ΅λλ€.
μ΄μ Fail2ban μ°¨λ¨ κΈ°κ°λ 5λΆλΆν° 30μΌκΉμ§, κ·Έλ¦¬κ³ μꡬ μ°¨λ¨μ λͺ©λ‘μμ κ³ λ₯΄μ€ μ μμ΅λλ€.
- μꡬ μ°¨λ¨μ΄ λͺ©λ‘μ μμ΅λλ€. μμ μλ μ΄ λ¨μ μ
λ ₯μΉΈμ
0μ λ£μ΄μΌ νκ³ , κ·Έ μ¬μ€μ΄ νλ©΄ μ΄λμλ μμμ΅λλ€. μ΄μ νκΈΒ·μμ΄ μ€λͺ λͺ¨λμ "μꡬ μ°¨λ¨(0μ΄)μ λ§λ£λμ§ μμ΅λλ€" λΌκ³ μ ν μμ΅λλ€. - 30μΌμ μ§μ ν μ μμ΅λλ€. μμ μ λ ₯μΉΈμ 604800μ΄(7μΌ)κ° μνμ΄λΌ 30μΌμ μμ ννν μ μμμ΅λλ€.
- μ νν μ΄λ₯Ό μνμλ©΄ μ§μ μ λ ₯(μ΄) μ κ³ λ₯΄μλ©΄ λ©λλ€. λͺ©λ‘μ μλ κ°μ΄ μ μ₯λΌ μμΌλ©΄ κ·Έ μΉΈμ΄ μ΄λ¦° μ±λ‘ νμλ©λλ€.
μ΄λ²μ ν¨κ» κ³ μΉ κ²: 첫 μ μ₯μμ μꡬ μ°¨λ¨μ΄ μ μ₯λμ§ μλ λ²κ·Έ. ν΄λΉ νΈμ€νΈμ Fail2ban μ€μ μ΄ μμ§ μλ μνμμ μꡬ μ°¨λ¨μ κ³ λ₯΄λ©΄ μ‘°μ©ν 1μκ°μΌλ‘ λ°λμ΄ μ μ₯λμ΅λλ€.
μ λ³΄ν΄ μ£Όμ @re-birkin λ κ°μ¬ν©λλ€. (#252)
μ°Έκ³ : μ΄λ―Έ κ±Έλ € μλ μ°¨λ¨μ κΈ°κ°μ μ€μ΄λ κ²½μ°, μ€μ΄λ λ§λ£ μκ°μ΄ nginxμ μ¦μ λ°μλμ§λ μμ΅λλ€. λ리λ κ²½μ°μ μλ‘ μ°¨λ¨νλ κ²½μ°λ μ¦μ λ°μλ©λλ€.
π 리λ€μ΄λ νΈ μ€μ μ΄ μμ μ μ μ©λμ§ μλ λ¬Έμ
APIμ nginxλ₯Ό λ³λ 컨ν μ΄λλ‘ μ΄μνλ ꡬμ±μμ, APIλ§ μ κ·Έλ μ΄λΒ·μ¬μμνλ©΄ 리λ€μ΄λ νΈ νΈμ€νΈ μ€μ μ΄ λμ€ν¬μμλ μ 리λλλ° μ΄λ―Έ λ μλ nginxλ μμ μ€μ μ κ³μ μλΉν μ μμμ΅λλ€. nginxλ μ€μ μ μμνκ±°λ λ€μ λΆλ¬μ¬ λ λ©λͺ¨λ¦¬λ‘ μ½κΈ° λλ¬Έμ, νμΌλ§ μ§μ°λ κ²μΌλ‘λ λμμ΄ λ°λμ§ μμ΅λλ€.
μ΄μ μμ μ 리λ€μ΄λ νΈ μ€μ μ λ€μ λ§λ λ€, κ°μ μ κΈ μμμ nginx -tμ μ¬μ μ©κΉμ§ μνν©λλ€. κ²μ¬κ° μ€ν¨νλ©΄ μ¬μ μ©νμ§ μκ³ μ΄μ λ₯Ό λ¨κΉλλ€.
μμ μμλ ν¨κ» μ 리ν΄μ, κΈ°λ³Έ μλ² μ€μ (μ§μ IP μ κ·Ό μ²λ¦¬ λ±)λ νμ€νκ² μ μ©λ©λλ€. μμ μλ nginxκ° μ€μ μ μ½λ μμ κ³Ό κ²ΉμΉλ μ΄μ κΈ°λκ³ μμμ΅λλ€.
λ³΄κ³ μ μμ μ ν¨κ» λ³΄λ΄ μ£Όμ @heygoodluck λ κ°μ¬ν©λλ€. (#261)
π§Ή μ μ§λ³΄μ
- 볡ꡬλ νμΌμ μμ μκ° API 컨ν μ΄λ κ³μ μΌλ‘ λ°λλλ€. nginxλ κ·Έλλ‘ μ½μ μ μμ΄ λμμλ μν₯μ΄ μμ΅λλ€.
- Let's Encrypt κ³μ μ¬μ¬μ© κ²½λ‘κ° μ΄λ² μμ μΌλ‘ μ²μ μ€μ λμν©λλ€. κ°±μ κ΄λ ¨ μ΄μμ΄ λ³΄μ΄λ©΄ μλ € μ£ΌμΈμ.
- TypeScript 7μ μμ§ λμ ν μ μμ΄(κ΄λ ¨ lint λκ΅¬κ° λ―Έμ§μ) μλ μ κ·Έλ μ΄λ μ μμμ μ μΈνμ΅λλ€.
apiΒ·ui μ΄λ―Έμ§λ₯Ό λͺ¨λ λ°μ λ€μ μ¬λ € μ£ΌμΈμ.
docker compose pull && docker compose up -d
π΄ Certificates β please read this one
The Renew button was erasing your certificate's private key
Pressing Renew on an SSL certificate made NPG blank the certificate, private key, issuer chain and Let's Encrypt account it keeps in the database. A successful renewal refilled them β but a failed one put the status back to "issued" and left the contents empty.
Nothing looks wrong when this happens. nginx serves TLS from the files on disk, not from the database, so HTTPS keeps working and nginx -t still passes. You find out when you download the certificate, restore a backup onto another server, or need to renew.
The same cause produced the reported "can't download a certificate right after creating it" symptom (#253). Just after issuance a cached copy without the key material was being returned, so the download was refused; about a minute later the cache expired and it worked again.
Uploaded certificates were worse. A certificate added through New certificate β Upload has never had its key material stored, since v1.0.1. The files were written to disk correctly, but the database side was always empty.
What changes in v2.45.0
- Writes that only change status are now separate from writes that store key material, so no path can wipe an existing key.
- The cache that could not carry a private key is gone, so downloading right after issuance works.
- Uploaded certificates store their key material.
- Rows that are already empty repair themselves. Ask for a download and NPG reads
fullchain.pemandprivkey.pemback from disk, refills the row and serves the file.
Do not press Renew before upgrading. On v2.13.18 β v2.44.0 that press erases whatever key material is left. Upgrade first.
After upgrading, two things are worth doing
- Download each certificate once from the list. Most automatically-issued certificates quietly repair themselves in the process.
- If a certificate still says its files could not restore it, the files on disk are gone too. For an automatically-issued certificate, press Renew (safe now). For one you uploaded, open it and use Update to upload the certificate and key again β adding a new certificate only creates a separate entry and does not fix this one.
Backups taken during this period may contain empty key material. If you plan to restore onto another server, upgrade, repair as above, and take a fresh backup.
Note: because the Let's Encrypt account was blanked along with the key, every renewal attempt registered a brand new account. Let's Encrypt caps new registrations at 10 per IP per 3 hours, so repeated attempts could block issuance entirely. The account is now stored separately and reused.
Thanks to @heygoodluck for the report. (#253)
ποΈ Backup restore
Restore failed completely if you had created your own block rules
If you ever created an exploit block rule of your own, that backup would not restore. The restore returned HTTP 500 with a database error and rolled the whole thing back. Backups containing only built-in rules restored fine, which is why some people hit this and others never did.
The cause was a statement referring to a constraint that does not exist β a path that has never worked, regardless of install age or upgrade history. Restore now completes, and rules that share a name are all preserved.
Related: restoring a backup taken on a newer version onto an older install also failed outright when it contained a built-in rule the target did not have. Those rules and their exclusions are now skipped and the rest is restored.
Restore was emptying the nginx default certificate
When a backup contained certificates, restoring it truncated nginx's default self-signed certificate to an empty file, which made the whole proxy fail its configuration test (nginx -t). While in that state nginx cannot reload, so no later change took effect.
The code emptied the destination file first and then set its permissions β and when that permission step failed, it stopped there, leaving the file empty. The API container runs with minimal privileges by design, so that step always fails for files created by the nginx container.
Restore now writes to a temporary file and swaps it into place. No failure can damage the existing file. The protection that keeps restored private keys unreadable by others is unchanged, and is now applied before any content is written.
If this already happened to you β configuration changes not taking effect, or nginx -t complaining it cannot load the certificate β restart the proxy container once and the default certificate is regenerated:
docker compose restart nginxπ« Ban durations β now on the Fail2ban screen too
The previous release unified the ban-duration list but missed the Fail2ban settings screen β which was the screen originally reported.
Fail2ban ban duration is now chosen from the same list: 5 minutes through 30 days, plus permanent.
- Permanent is in the list. It used to require typing
0into a seconds box, and nothing on screen said so. Both the Korean and English help text now state that a permanent ban (0 seconds) never expires. - 30 days can be selected. The old box capped out at 604800 seconds (7 days), so 30 days could not be expressed at all.
- Choose Custom (seconds) for an exact number. A stored value that is not one of the offered durations opens on that field.
Fixed along the way: permanent was not saved on the first save. Choosing permanent for a host that had no Fail2ban configuration yet silently stored one hour instead.
Thanks to @re-birkin for the report. (#252)
Note: shortening an existing ban does not push the earlier expiry to nginx immediately. Extending a ban and adding a new one both apply immediately.
π Redirect configuration was not applied at startup
In deployments where API and nginx are separate containers, upgrading and restarting only the API cleaned up redirect host configuration on disk while an already-running nginx kept serving the old configuration. nginx reads configuration into memory when it starts or reloads, so deleting files alone changes nothing.
Startup now regenerates redirect configuration and then runs nginx -t and applies it within the same lock. If the test fails it does not apply, and it says why.
Startup ordering was tidied at the same time, so the default server configuration (direct-IP handling and similar) is reliably applied too β previously it depended on happening to land before nginx read its configuration.
Thanks to @heygoodluck for the report and the fix. (#261)
π§Ή Maintenance
- Restored files are now owned by the API container's account. nginx still reads them, so there is no behavioral change.
- The Let's Encrypt account-reuse path runs for real for the first time with this fix. Please report anything unusual about renewals.
- TypeScript 7 cannot be adopted yet (the lint toolchain does not support it), so it is excluded from automatic upgrade proposals.
Pull both the api and ui images and recreate:
docker compose pull && docker compose up -d
Docker Images
docker pull svrforum/nginxproxyguard-api:2.45.0
docker pull svrforum/nginxproxyguard-ui:2.45.0
docker pull svrforum/nginxproxyguard-nginx:2.45.0Architectures: linux/amd64, linux/arm64
| Component | Status |
|---|---|
| API | Built |
| UI | Built |
| Nginx | Skipped (no changes) |
Contributors: @heygoodluck