upstream 오류 잡기

우분투에 Nginx 를 설치하고 오류 로그를 확인하는데 하루에 몇메가씩 쌓입니다.

에러 내용은 다음과 같습니다..

2017/03/07 20:25:28 [error] 26754#26754: *852587 upstream sent too big header while reading response header from upstream, client: 146.185.223.197, server: eond.com, request: "POST /eond/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/eond.sock:", host: "eond.com", referrer: "http://eond.com/eond/?mid=link&document_srl=&page=&accept_agreement=&user_id=alpygCqPlWkE&password1=&password2=&user_name=jonn1&nick_name=jonn1&email_address=email%40gmail.com&homepage=http%3A%2F%2Fwww.paranormal-mystery.bullyrr.org%2Famericana%2Fepub-257-4479-razor.pdf&blog=LSiawCYY&birthday=&allow_mailing=Y&open_whyjoin=&whyjoin=comment3%2C+http%3A%2F%2Fwww.urban-fantasy.vino-vortex.com%2Fhistory-american-civil-war%2Fepub-24-1500-snorkel_maui_and_lanai_guide_to_the_underwater_world_of_hawaii.pdf+Snorkel+Maui+and+Lanai%3A+Guide+to+the+underwater+world+of+Hawaii%2C++%25O%2C+http%3A%2F%2Fwww.christian-contemporary-fiction.bullyrr.org%2Fgerman-literature%2Fepub-290-3434-247_penyembuh_tradisional_kencing_manis_darah_tinggi_lemah_jantung_lutut_kdll_.pdf+247+Penyembuh+Tradisional+Kencing+Manis%2C+Darah+Tinggi%2C+Lemah+Jantung%2C+Lutut+(Kdll)%2C++177%2C+http%3A%2F%2Fwww.paranormal-mystery.bullyrr.org%2Famericana%2Fepub-157-3222-the_art_of_coarse_acting_or_how_to_wreck_an_amateur_dramatic_society.pdf+The+Art+Of+Coarse+Acting%2C+Or%2C+How+To+Wreck+An+Amateur+Dramatic+Society%2C++%3D%5B%2C+http%3A%2F%2Fwww.gardening.todolegal.co%2Fpoland%2Fepub-181-2885-his_uptown_girl.pdf+His+Uptown+Girl%2C++bjy%2C+http%3A%2F%2Fwww.swedish-literature.autocontestadores.com%2Fsocial-change%2Fepub-127-2341-passing_the_music_down.pdf+Passing+the+Music+Down%2C++37299%2C+http%3A%2F%2Fwww.gardening.todolegal.co%2Fpoland%2Fepub-180-751-living_image.pdf+Living+Image%2C++fddfwl%2C+http%3A%2F%2Fwww.fractured-fairy-tales.todolegal.co%2Ftrue-crime%2Fepub-388-2859-%25D8%25A8%25D9%2588%25D8%25AF%25D8%25A7_%25D8%25B2%25D9%2586%25D8%25AF%25DA%25AF%25DB%258C_%25D8%25A8%25D9%2588%25D8%25AF%25D8%25A7_%25D8%25A2%25D9%258A%25D9%258A%25D9%2586_%25D8%25A7%25D9%2588_%25D9%2588_%25D8%25A7%25
2017/03/07 20:25:54 [warn] 26755#26755: *852906 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/3/84/0000024843 while reading upstream, client: 146.185.223.197, server: eond.com, request: "GET /eond/?mid=link&document_srl=&page=&accept_agreement=&user_id=kbPTdoJnQlWa&password1=&password2=&user_name=jonn1&nick_name=jonn1&email_address=emai1l%40gmail.com&homepage=http%3A%2F%2Fwww.eastern-philosophy.loumila.com%2Fyoung-adult-romance%2Fepub-159-2078-living_buddha_zen_their_singing_can_be_heard_for_ten_thousand_miles_celebrating_the_great_peace.pdf&blog=WTVhHVEHyZPKhnRH&birthday=&allow_mailing=Y&open_whyjoin=&whyjoin=comment6%2C+http%3A%2F%2Fwww.fantasy-romance.buyandsellwithmario.net%2Fsocial-justice%2Fepub-58-2046-the_arkadians.pdf+The+Arkadians%2C++ajko%2C+http%3A%2F%2Fwww.picu.omarsayeed.org%2Fhungarian-literature%2Fepub-331-1305-ride_back_10.pdf+Ride+Back+10%2C++%3A%5B%5B%2C+http%3A%2F%2Fwww.graphic-novels-comics-manga.howtobegreatatimprov.com%2Freference%2Fepub-359-3245-heisenberg_de_la_incertidumbre_cu%25C3%25A1ntica_a_la_bomba_at%25C3%25B3mica_nazi.pdf+HEISENBERG.+De+la+incertidumbre+cu%C3%A1ntica+a+la+bomba+at%C3%B3mica+nazi%2C++8DD%2C+http%3A%2F%2Fwww.superstition.howtobegreatatimprov.com%2Fmagical-realism%2Fepub-295-3692-the_last_way_station.pdf+The+Last+Way+Station%2C++asofc%2C+http%3A%2F%2Fwww.superstition.howtobegreatatimprov.com%2Fmagical-realism%2Fepub-241-4435-niemand_liebt_november.pdf+Niemand+liebt+November%2C++tgxtn%2C+http%3A%2F%2Fwww.eastern-philosophy.loumila.com%2Fyoung-adult-romance%2Fepub-71-3442-untamed.pdf+Untamed%2C++ksrqm%2C+http%3A%2F%2Fwww.disability-studies.loumila.com%2Fsteampunk-romance%2Fepub-199-1663-the_big_screen_comedies_of_mel_brooks.pdf+The+Big+Screen+Comedies+of+Mel+Brooks%2C++sbjnwd%2C+http%3A%2F%2Fwww.fiction.buyandsellwithmario.net%2Fazeroth%2Fepub-66-1633-the_nashville_way_racial_etiquette_and_the_struggle_for_social_justice_in_a_southern_city.pdf+The+Nashville+Way%3A+Racial+Etiquette+and+the+Struggle+for+Social+Justice+in+a+Southern+Ci
2017/03/07 20:25:56 [warn] 26755#26755: *852960 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/4/84/0000024844 while reading upstream, client: 146.185.223.107, server: eond.com, request: "GET /eond/?mid=link&document_srl=&page=&accept_agreement=&user_id=imDwzumUOASSlcYi&password1=&password2=&user_name=jonn3&nick_name=jonn3&email_address=email%40gmail.com&homepage=http%3A%2F%2Fwww.chemistry.gasimzade.org%2Fcomics-manga%2Fepub-328-3145-star_magic_the_wisdom_of_the_constellations_for_pagans_amp_wiccans.pdf&blog=UzDsyZVAaWivJQBhY&birthday=&allow_mailing=Y&open_whyjoin=&whyjoin=comment4%2C+http%3A%2F%2Fwww.school-stories.knowledge4cash.com%2Fmusic%2Fepub-284-4684-lucifer_s_garden_of_verses_volume_two_darlin_niki.pdf+Lucifer's+Garden+of+Verses%3A+Volume+Two+-+Darlin'+Niki%2C++07866%2C+http%3A%2F%2Fwww.detective.danfeldcontracting.com%2Fcanadian-literature%2Fepub-296-13-flame_in_the_night.pdf+Flame+in+the+Night%2C++31208%2C+http%3A%2F%2Fwww.soviet-history.gasimzade.org%2Fkomik%2Fepub-81-4156-rasetsu_vol_6.pdf+Rasetsu%2C+Vol.+6%2C++980%2C+http%3A%2F%2Fwww.nursing.knowledge4cash.com%2Fdisability%2Fepub-384-4007-collection_from_riyad_us_saliheen_with_commentary_on_ahadith_.pdf+Collection+from+Riyad-us-Saliheen+(with+commentary+on+Ahadith)%2C++hcwrb%2C+http%3A%2F%2Fwww.young-adult-romance.danfeldcontracting.com%2Fchancellorsville-campaign%2Fepub-293-3635-oregon_trail.pdf+Oregon+Trail%2C++utlwtg%2C+http%3A%2F%2Fwww.robots.milomethod.com%2Froman-britain%2Fepub-52-1708-apocalypse_rising.pdf+Apocalypse+Rising%2C++%3E%3A(%2C+http%3A%2F%2Fwww.modern.knowledge4cash.com%2Froad-trip%2Fepub-351-1698-woman_bewitched.pdf+Woman+Bewitched%2C++%25%5D%2C+http%3A%2F%2Fwww.modern.knowledge4cash.com%2Froad-trip%2Fepub-248-4983-help_i_m_teaching_middle_school_science.pdf+Help!+I'm+Teaching+Middle+School+Science%2C++4370%2C+http%3A%2F%2Fwww.m-m-contemporary.knowledge4cash.com%2Fevangelism%2Fepub-154-3170-%25E6%259D%25B1%25E6%25B5%25B7%25E9%2581%2593hisame_1_tokaido_hisame_1_.pdf+%E6%9D%B1%E6%B5%B7%E9%81%93HI
2017/03/07 20:26:01 [warn] 26754#26754: *853016 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/5/84/0000024845 while reading upstream, client: 146.185.223.197, server: eond.com, request: "GET /eond/?mid=link&document_srl=&page=&accept_agreement=&user_id=sKYMUdHGFqzJPu&password1=&password2=&user_name=jonn1&nick_name=jonn1&email_address=email%40gmail.com&homepage=http%3A%2F%2Fwww.superstition.howtobegreatatimprov.com%2Fmagical-realism%2Fepub-161-2629-so_you_want_to_be_an_insurance_agent_2nd_edition.pdf&blog=RhEaDacBl&birthday=&allow_mailing=Y&open_whyjoin=&whyjoin=comment6%2C+http%3A%2F%2Fwww.graphic-novels-comics-manga.howtobegreatatimprov.com%2Freference%2Fepub-354-1395-o_co_nas_pytaja_wielcy_filozofowie_seria_i.pdf+O+co+nas+pytaja+wielcy+filozofowie%3A+seria+I%2C++dtuczb%2C+http%3A%2F%2Fwww.disability-studies.loumila.com%2Fsteampunk-romance%2Fepub-46-19-last_steps_maurice_blanchot_s_exilic_writing.pdf+Last+Steps%3A+Maurice+Blanchot's+Exilic+Writing%2C++iflyec%2C+http%3A%2F%2Fwww.boys-love.buyandsellwithmario.net%2Fretellings%2Fepub-164-2494-lack_of_money_is_the_root_of_all_evil_mark_twain_s_timeless_wisdom_on_money_and_wealth_for_today_s_investor.pdf+Lack+of+Money+is+the+Root+of+All+Evil%3A+Mark+Twain's+Timeless+Wisdom+on+Money+and+Wealth+for+Today's+Investor%2C++931154%2C+http%3A%2F%2Fwww.picu.omarsayeed.org%2Fhungarian-literature%2Fepub-283-1161-tokala.pdf+Tokala%2C++dfv%2C+http%3A%2F%2Fwww.graphic-novels-comics-manga.howtobegreatatimprov.com%2Freference%2Fepub-302-3545-children_of_the_storm.pdf+Children+of+the+Storm%2C++%25%5D%5D%5D%2C+http%3A%2F%2Fwww.school-stories.omarsayeed.org%2Fhorse-racing%2Fepub-271-3491-ransacking_paris_a_year_with_montaigne_and_friends.pdf+Ransacking+Paris%3A+A+Year+with+Montaigne+and+Friends%2C++%3E%3A%5D%2C+http%3A%2F%2Fwww.adoption.buyandsellwithmario.net%2Fhydrogeology%2Fepub-102-1315-the_beginnings_of_new_england.pdf+The+Beginnings+of+New+England%2C++994492%2C+http%3A%2F%2Fwww.leningrad.loumila.com%2Frecreation%2Fepub-151-3764-spending_the_h
2017/03/07 20:26:46 [warn] 26755#26755: *853520 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/7/85/0000024857 while reading upstream, client: 146.185.223.197, server: eond.com, request: "GET /eond/?mid=link&document_srl=&page=&accept_agreement=&user_id=SlSITidb&password1=&password2=&user_name=jonn3&nick_name=jonn3&email_address=email%40gmail.com&homepage=http%3A%2F%2Fwww.azeroth.howtobegreatatimprov.com%2Flandscaping%2Fepub-44-2396-stuart_little_study_guide_novel_units_.pdf&blog=zQmOngGa&birthday=&allow_mailing=Y&open_whyjoin=&whyjoin=comment3%2C+http%3A%2F%2Fwww.fiction.buyandsellwithmario.net%2Fazeroth%2Fepub-8-1536-what_you_are_now_enjoying.pdf+What+You+Are+Now+Enjoying%2C++%3E%3A-%5D%5D%2C+http%3A%2F%2Fwww.fantasy-romance.buyandsellwithmario.net%2Fsocial-justice%2Fepub-355-538-conscious_mind_in_the_physical_world.pdf+Conscious+Mind+in+the+Physical+World%2C++6002%2C+http%3A%2F%2Fwww.picu.omarsayeed.org%2Fhungarian-literature%2Fepub-338-4882-military_mayhem_2_500_years_of_soldierly_sleaze_and_scandal.pdf+Military+Mayhem%3A+2%2C500+Years+of+Soldierly+Sleaze+and+Scandal%2C++%25-P%2C+http%3A%2F%2Fwww.m-m-m-f.buyandsellwithmario.net%2Fart-and-photography%2Fepub-23-3477-cowboys_and_indians.pdf+Cowboys+and+Indians%2C++yormf%2C+http%3A%2F%2Fwww.american-novels.omarsayeed.org%2Fstuart%2Fepub-15-1582-tom_brady_never_quit_quarterback.pdf+Tom+Brady%3A+Never-Quit+Quarterback%2C++%3A-)%2C+http%3A%2F%2Fwww.world-war-ii.loumila.com%2Fthreesome%2Fepub-88-2859-aghora_at_the_left_hand_of_god.pdf+Aghora%3A+At+the+Left+Hand+of+God%2C++bsao%2C+http%3A%2F%2Fwww.american-novels.omarsayeed.org%2Fstuart%2Fepub-182-2472-the_married_guy_s_guide_to_great_sex.pdf+The+Married+Guy's+Guide+to+Great+Sex%2C++mcwoie%2C+http%3A%2F%2Fwww.m-m-m-f.buyandsellwithmario.net%2Fart-and-photography%2Fepub-54-4441-those_7_references_a_study_of_7_references_to_homosexuality_in_the_bible.pdf+Those+7+References%3A+A+Study+of+7+References+to+Homosexuality+in+the+Bible%2C++pgvwr%2C+http%3A%2F%2Fwww.boys-love.buyandsellwithm

사실 문제는 파일용량이 커서 php에서 처리하는 용량이 모자른 것보다..

에러 로그를 살펴보시면, 

GET /eond/?mid=link&document_srl=&page=&accept_agreement=&user_id=RulhmcDXOqPqfgc&password1=&password2=&user_name=jonn1&nick_name=jonn1&email_address=email%40gmail.com&homepage=http%3A%2F%2Fwww.interracial-romance.heartwoodcellars.com%2Famericana%2Fepub-229-1075-sejf.pdf&blog=VWSHhixtTzBlmvLHu&birthday=&allow_mailing=Y&open_whyjoin=&whyjoin=comment3%2C+http%3A%2F%2Fwww.young-adult-fantasy.southdenvermassive.com%2Fhealth%2Fepub-371-2992-jutro_niedziela_i_inne_opowiadania.pdf+Jutro+niedziela+i+inne+opowiadania%2C++vxdn%2C+http%3A%2F%2Fwww.flash-fiction.pilatesnewswire.com%2Fthreesome%2Fepub-204-3291-das_kleine_buch_des_friedens_das_kleine_buch_des_friedens.pdf+Das+kleine+Buch+des+Friedens+Das+kleine+Buch+des+Friedens%2C++925%2C+http%3A%2F%2Fwww.gods.heartwoodcellars.com%2Fcanadian-literature%2Fepub-41-866-the_island_of_lost_maps_a_true_story_of_cartographic_crime.pdf+The+Island+of+Lost+Maps%3A+A+True+Story+of+Cartographic+Crime%2C++%3D-O%2C+http%3A%2F%2Fwww.coding.pilatesnewswire.com%2Fhorticulture%2Fepub-13-2467-worship_the_king.pdf+Worship+the+King%2C++%3D%5D%5D%5D%2C+http%3A%2F%2Fwww.tudor-period.pilatesnewswire.com%2F20th-century%2Fepub-12-3772-liar_s_house.pdf+Liar's+House%2C++009317%2C+http%3A%2F%2Fwww.public-transport.heartwoodcellars.com%2Fbiblical%2Fepub-228-4387-llewellyn_s_2012_witches_spell_a_day_almanac.pdf+Llewellyn's+2012+Witches'+Spell-A-Day+Almanac%2C++8-%5D%5D%5D%2C+http%3A%2F%2Fwww.public-transport.heartwoodcellars.com%2Fbiblical%2Fepub-118-3422-design_and_nature_v_comparing_design_in_nature_with_science_and_engineering_wit_transactions_on_ecology_and_the_environment_.pdf

뭔가 아이디랑 비번을 대입해서 이런 식으로 계속 쌓이고 있습니다 -_-a?;;

해당 아이피를 막는 것이 해결방법인지 @_@;;

 

우선 nginx 에서 user.conf 파일에서

location / {
        ...
        proxy_read_timeout 150;
        ...
    }

이렇게 수정해주기도 했고요..

 

참조

1) https://www.scalescale.com/tips/nginx/upstream-timed-out/#

2) http://nginx.org/en/docs/http/ngx_http_upstream_module.html

3) http://howtounix.info/howto/110-connection-timed-out-error-in-nginx

4) http://stackoverflow.com/questions/28347184/upstream-timed-out-110-connection-timed-out-for-static-content

5) https://tech.mendix.com/linux/2014/12/26/custom-monsters/

6) https://blog.gomgom.io/502-bad-gateway-solution-on-nginx-php_fpm/

7) http://blog.pearljam.co.kr/4715/

  • profile

    에러가 발생할 때 타임아웃을 늘리는 것은 해결책이 아닙니다. 증상을 숨기고 서버 상태를 더 나쁘게 만들 뿐이지요. 어떤 경우에도 1분 이상의 타임아웃 설정은 권장하지 않습니다. 특히 PHP에서 타임아웃이 발생할 때는 오히려 타임아웃을 더 줄이는 것이 도움이 되기도 합니다.

     

    버퍼 크기가 부족하다는 오류는 버퍼 크기와 관련된 여러 가지 설정을 조정하는 것으로 어느 정도 제거가 가능하지만, 악의적인 방문자 때문에 발생하는 오류라면 그냥 오류가 나도록 내버려두는 편이 안전할 수도 있어요. 오류가 나지 않으면 해당 요청이 공격자의 의도대로 작동하여 정말로 해킹당하거나 스팸이 등록될지도 모르니까요.

     

    이상한 요청을 보내는 IP는 차단해 버리세요.

  • profile profile
    link 게시판에서만 해당 현상이 발생되서 일단 link 게시판에는 로그인 회원만 볼 수 있게 수정했어요.
    감사합니다.