-
Notifications
You must be signed in to change notification settings - Fork 10
Nginx
hyeonggyu ham edited this page Nov 14, 2019
·
1 revision
- μ νν λΌμ°ν
λ¬Έμ
- location μ€μ
location /api { proxy_pass http://server; } # 127.0.0.1/api/rooms κ²°κ³Ό : get /api/rooms location /api { proxy_pass http://server/; } # 127.0.0.1/api/rooms κ²°κ³Ό : get //rooms location /api/ { proxy_pass http://server/; } # 127.0.0.1/api/rooms κ²°κ³Ό : get /rooms # μ¦ λ§¨ μλ κ²°κ³Όκ° λ§λ€.
-
dockerλ₯Ό μ°λ nginx server λ΄μ λΆκΈ°μ λ°λΌ proxy_passμλ μ΄λ€μμΌλ‘ μ£Όμλ₯Ό λ£μ΄μ€μΌ νλμ§?
- μ°Έκ³
- By default Compose sets up a single network for your app. Each container for a service joins the default network and is both reachable by other containers on that network, and discoverable by them at a hostname identical to the container name.
- κ°λ¨ λ²μ : κΈ°λ³Έκ°μΌλ‘ composeλ₯Ό μ¬μ©νλ©΄ ν κ°μ λ€νΈμν¬μ μ°κ²°λλ€. κ° μ»¨ν μ΄λλ€μ κΈ°λ³Έ λ€νΈμν¬μ λ€μ΄μ€κ³ , ν΄λΉνλ λ€νΈμν¬μμ μλ‘ μ κ·Όν μ μλ€. κ·Έλ¦¬κ³ containerμ λμΌν μ΄λ¦μΌλ‘ νΈμ€νΈμ΄λ¦μ μ°Ύμ μ μλ€.
-
upstreamμ μ μ‘΄μ¬νλμ§?
- μλ λ§ν¬μμ ννΈλ₯Ό μ»μμ
- https://gompro.postype.com/post/1735800
- docker container μ΄λ¦μ μ¨μ λμΌ λ€νΈμν¬ λ΄μ μλ containerλ₯Ό μ°Ύμμ μ°κ²°νλ κ² κ°λ€. 127.0.0.1μ΄ μλλΌ
-
upstream app { server server:3030; # μλ²μ 컨ν μ΄λ λͺ } server { listen 80; location / { proxy_pass http://app; } }