λ‘κ·Έλ₯Ό νμΈν΄λ³΄λ λ‘λ벨λ°μ± μννμΈμ΄ κ³μ 404κ° λ΄λ€. 곡μλ¬Έμλ₯Ό 보λκΉ μνμ½λλ₯Ό λ°ννμ§ μμμ μΈκ² κ°μλ€.
Target.ResponseCodeMismatch
μ€λͺ : μν νμΈμ΄ μμ HTTP μ½λλ₯Ό λ°ννμ§ μμμ΅λλ€.
ν΄κ²° λ°©λ²:
- μ±κ³΅ μ½λλ λμμΌλ‘λΆν° μ±κ³΅μ μΈ μλ΅μ νμΈν λ μ¬μ©νλ HTTP μ½λμ λλ€. 200~499 μ¬μ΄μ κ° λλ κ° λ²μλ₯Ό μ§μ ν μ μμ΅λλ€. κΈ°λ³Έκ°μ 200μ λλ€. λ‘λ λ°Έλ°μ μν νμΈ κ΅¬μ±μ νμΈνμ¬ μμ ν κ²μΌλ‘ μμλλ μ±κ³΅ μ½λλ₯Ό νμΈνμμμ€. κ·Έλ° λ€μ, μΉ μλ² μ‘μΈμ€ λ‘κ·Έλ₯Ό κ²μ¬νμ¬ μμ μ±κ³΅ μ½λκ° λ°νλλμ§ νμΈνμμμ€. νμμ λ°λΌ μ±κ³΅ μ½λ κ°μ μμ νμμμ€.
- ping κ²½λ‘κ° μ ν¨νμ§ νμΈνμμμ€. ping κ²½λ‘λ μν νμΈμ μν λμμ λν λμμ λλ€. λ°λμ μ ν¨ν URI(/path?query)λ₯Ό μ§μ νμμμ€. κΈ°λ³Έκ°μ /μ λλ€. νμμ λ°λΌ ping κ²½λ‘ κ°μ μμ νμμμ€.
Environment health has transitioned from Ok to Severe. 81.8 % of the requests are erroring with HTTP 4xx
I would like to ask for help about Elastic Beanstalk error: Environment health has transitioned from Ok to Severe. 81.8 % of the requests are erroring with HTTP 4xx. I read some articles here and I
stackoverflow.com
μ stack overflow κΈ λλ‘
4xxμλ¬λ₯Ό 무μνλ conf νμΌμ .ebextensions νμμ μμ±νλ€.
.ebextensions/.ebextensions/healthd_ignore_4xx.config
files:
"/etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker-proxy.conf":
mode: "000644"
owner: root
group: root
content: |
# modification No.1
map $status $logflag {
404 0;
403 0;
default 1;
}
map $http_upgrade $connection_upgrade {
default "upgrade";
"" "";
}
server {
listen 80;
gzip on;
gzip_comp_level 4;
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})T(\d{2})") {
set $year $1;
set $month $2;
set $day $3;
set $hour $4;
}
# modification No.2
# access_log /var/log/nginx/healthd/application.log.$year-$month-$day-$hour healthd;
access_log /var/log/nginx/healthd/application.log.$year-$month-$day-$hour healthd if=$logflag;
access_log /var/log/nginx/access.log;
location / {
proxy_pass http://docker;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
λ κ°μ κ²½μ°λ μ€νλ§λΆνΈ νλ‘μ νΈλ₯Ό λ°°ν¬νκ³ μμλ€.
μ΄ νλ‘μΈμ€λ₯Ό 보면 μνκ²μ¬ κ²½λ‘κ° / (λ£¨νΈ κ²½λ‘) μ΄λ€. κ·Έλμ μ€νλ§λΆνΈ νλ‘μ νΈμμλ "/"λ₯Ό URIλ‘ κ°μ§λ apiλ₯Ό νλ λ§λ€μ΄μ€¬λλ νλλΆμ΄ λ€μ΄μλ€!
λ‘λ 벨λ°μ±.. μ΄λ ΅λ€.. ν΄