μμ§μμ€ νΈλν½ λ―Έλ¬λ§
μμ§μμ€(Nginx)μ ngx_http_mirror_module
λͺ¨λμ μ¬μ©νλ©΄ 리λ²μ€ νλ‘μλ‘ μ ν리μΌμ΄μ
μ μ λ¬νλ μΌλΆ νΈλν½μ 볡μ νμ¬ λ€λ₯Έ μ ν리μΌμ΄μ
μΌλ‘ μ λ¬ν μ μλ€. μ°λ¦¬λ μ΄κ²μ νμ©ν΄μ μ ν리μΌμ΄μ
μ μ λ¬νλ νΈλν½μ μ μ μλ μν©μ΄μ§λ§ μ΄λ ν λ¬Έμ κ° λ°μνκ³ μμλ ν
μ€νΈλ₯Ό μν μ ν리μΌμ΄μ
μ λ§λ€μ΄μ ꡬλνκ³ λλ²κ·Έν μ μλ νκ²½μ λ§λ€ μ μλ€.
νΈλν½ λ―Έλ¬λ§ μ€μ
nginx.confhttp { upstream backend_for_test { server app:8081; keepalive 128; } server { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # hop-by-hop proxy_http_version 1.1; location /mtls/ { proxy_pass http://backend; mirror /mirror; mirror_request_body on; } location /mtls_mirror { internal; proxy_pass http://backend_for_test$request_uri; } } }
λ¬Έμ μ λν μμΈμ νμ νκΈ° μν μμ²μ λ°λ μ λ³΄κ° νμνμ§ μμ κ²½μ° mirror_request_body μ΅μ μ λΉνμ±ν(off) νμΈμ.
νΈλν½ λ―Έλ¬λ§ μΆλ ₯
μΌλ°μ μΌλ‘ μλ² ν¬νΈ μ€νμ νμΈνλλ° μ¬μ©νλ Netcat λͺ λ Ήμ΄λ₯Ό ν΅ν΄ κ°λ¨ν μλ²λ₯Ό μ€ννκ³ λ³΅μ λ νΈλν½μ λν μ 보λ₯Ό μΆλ ₯ν΄λ³Ό μ μλ€.
nc -lp localhost 8081
AWS νκ²½μμ μ΄μνλ μ ν리μΌμ΄μ μ λν νΈλν½ λ―Έλ¬λ§μ VPC νΈλν½ λ―Έλ¬λ§μ ꡬμ±νλ κ²μ΄ μ ν©ν©λλ€.