nginxλ₯Ό μ²μ μ νλ μ΄λ³΄μλΆν° μ λ¬Έκ° μμ€κΉμ§ λ¨κ³λ³λ‘ νμ΅ν μ μλ μ’ ν© κ°μ΄λμ λλ€. λͺ¨λ μμ λ Docker νκ²½μμ λ°λ‘ μ€νν μ μλλ‘ κ΅¬μ±λμ΄ μμ΅λλ€.
# μ μ₯μ ν΄λ‘
git clone https://github.com/hundong2/nginx_example.git
cd nginx_example
# κ°μ΄λ ννμ΄μ§ μ€ν
docker compose --profile guide up -d
# λΈλΌμ°μ μμ http://localhost:8000 νμΈ
# λͺ¨λ μμ μ€ν
docker compose --profile all up -dnginx_example/
βββ nginx-guide.md # π μμ ν κ°μ΄λ λ¬Έμ
βββ docker-compose.yml # π³ λ©μΈ Docker Compose νμΌ
βββ html/ # π κ°μ΄λ ννμ΄μ§
β βββ index.html
βββ examples/ # π λ¨κ³λ³ μμ λ€
β βββ beginner/ # λ 벨 1: κΈ°μ΄
β β βββ 01-basic-server/ # κΈ°λ³Έ μΉ μλ²
β β βββ 02-virtual-hosts/ # κ°μ νΈμ€νΈ
β βββ intermediate/ # λ 벨 2: μ€κΈ (μ€λΉ μ€)
β βββ advanced/ # λ 벨 3: κ³ κΈ (μ€λΉ μ€)
β βββ expert/ # λ 벨 4: μ λ¬Έκ° (μ€λΉ μ€)
βββ nginx_config/ # κΈ°μ‘΄ μ€μ νμΌλ€
βββ README.md # μ΄ νμΌ
- β κΈ°λ³Έ μΉ μλ² μ€μ - nginxμ κΈ°λ³Έ κ°λ κ³Ό μ μ νμΌ μλΉ
- β Virtual Hosts (κ°μ νΈμ€νΈ) - νοΏ½οΏ½οΏ½μ μλ²λ‘ μ¬λ¬ μΉμ¬μ΄νΈ νΈμ€ν
- β κΈ°λ³Έ 보μ ν€λ - μΉμ¬μ΄νΈ 보μμ μν HTTP 보μ ν€λ μ€μ
- π 리λ²μ€ νλ‘μ μ€μ
- π λ‘λ λ°Έλ°μ±
- π SSL/TLS μ€μ
- π μΊμ± λ° μμΆ
- π Rate Limiting
- π κ³ κΈ μΊμ± μ λ΅
- π κ³ κΈ λ³΄μ μ€μ
- π λ‘κ·Έ λΆμ λ° λͺ¨λν°λ§
- π μ±λ₯ μ΅μ ν λ° νλ
- π Lua μ€ν¬λ¦½ν
- π κ³ κΈ λͺ¨λν°λ§ μμ€ν
- π λΈλ£¨-κ·Έλ¦° λ°°ν¬
docker compose --profile guide up -d
# http://localhost:8000 μ μ# κΈ°λ³Έ μΉ μλ²
docker compose --profile basic up -d
# http://localhost:8001 μ μ
# Virtual Hosts
docker compose --profile virtual-hosts up -d
# Host ν€λλ‘ ν
μ€νΈ:
# curl -H "Host: site1.local" http://localhost:8002
# curl -H "Host: site2.local" http://localhost:8002
# 보μ ν€λ
docker compose --profile security up -d
# http://localhost:8003 μ μ
# curl -I http://localhost:8003 (ν€λ νμΈ)docker compose --profile all up -ddocker compose down| ν¬νΈ | μλΉμ€ | μ€λͺ |
|---|---|---|
| 8000 | κ°μ΄λ ννμ΄μ§ | μ 체 κ°μ΄λ λ° μμ λ§ν¬ |
| 8001 | κΈ°λ³Έ μΉ μλ² | nginx κΈ°λ³Έ μ€μ μμ |
| 8002 | Virtual Hosts | κ°μ νΈμ€νΈ μμ |
| 8003 | 보μ ν€λ | HTTP 보μ ν€λ μμ |
μ 체 κ°μ΄λ λ¬Έμλ nginx-guide.mdλ₯Ό μ°Έμ‘°νμΈμ. κ° λ λ²¨λ³ μμΈν μ€λͺ κ³Ό μ€μ΅ λ΄μ©μ΄ ν¬ν¨λμ΄ μμ΅λλ€.
κΈ°μ‘΄ λ°©μμΌλ‘λ μ¬μ ν μ€ν κ°λ₯ν©λλ€:
# κΈ°μ‘΄ λ°©μ
docker build -t my-nginx:latest .
./run-nginx.shμ΄ νλ‘μ νΈμ κΈ°μ¬νκ³ μΆμΌμλ©΄:
- Fork this repository
- Create a feature branch
- Make your changes
- Submit a Pull Request
μ΄ νλ‘μ νΈλ MIT λΌμ΄μ μ€ νμ μμ΅λλ€. μμΈν λ΄μ©μ LICENSE νμΌμ μ°Έμ‘°νμΈμ.
π― λͺ©ν: nginxλ₯Ό μμ ν λ§μ€ν°νμ¬ μ€λ¬΄μμ μμ μκ² νμ©ν μ μλλ‘ λλ κ²μ λλ€!
κΆκΈν μ μ΄ μμΌλ©΄ Issuesλ₯Ό ν΅ν΄ μΈμ λ μ§ λ¬Έμν΄μ£ΌμΈμ! π¬