{"id":717,"date":"2022-09-05T07:32:52","date_gmt":"2022-09-05T07:32:52","guid":{"rendered":"https:\/\/sunucucozumleri.com\/?p=717"},"modified":"2022-10-09T19:27:02","modified_gmt":"2022-10-09T19:27:02","slug":"502-bad-gateway-nginx-hatasinin-cozumu","status":"publish","type":"post","link":"https:\/\/sunucucozumleri.com\/blog\/502-bad-gateway-nginx-hatasinin-cozumu\/","title":{"rendered":"502 Bad Gateway Nginx Hatas\u0131n\u0131n \u00c7\u00f6z\u00fcm\u00fc"},"content":{"rendered":"<p>Merhabalar,<br \/>\nBug\u00fcn bilgi bankam\u0131za ekleyece\u011fimiz makalemizde &#8220;502 Bad Gateway Nginx&#8221; hatas\u0131n\u0131n \u00e7\u00f6z\u00fcm\u00fcne de\u011finece\u011fiz.<\/p>\n<p>\u00d6ncelikle\u00a0<strong>502 Bad Gateway<\/strong>\u00a0ve\u00a0<strong>504 Gateway Time-out<\/strong>\u00a0hatalar\u0131 genellikle \u00e7ok kar\u0131\u015ft\u0131r\u0131l\u0131r.<\/p>\n<p>Genel anlamda benzerlik ta\u015f\u0131sada birbirinden ay\u0131ran en \u00f6nemli \u00f6zellik, 502 Bad Gateway d\u0131\u015far\u0131dan \u00e7a\u011fr\u0131lan dosyalar, 504 Gateway Time-out ise yaz\u0131l\u0131m da bulunan hatal\u0131 kodlama sebebiyle kar\u015f\u0131m\u0131za \u00e7\u0131kmaktad\u0131r.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/image.prntscr.com\/image\/87afbbc74fcf481aad116a87a2d2c912.png\" alt=\"504 gateway time-out\" width=\"894\" height=\"127\" title=\"\"><\/p>\n<p>502 Bad Gateway <a href=\"https:\/\/sunucucozumleri.com\/blog\/080-nginx-reverse-proxy-nasil-kurulur\/\">Nginx<\/a> hatas\u0131 alman\u0131z\u0131n bir \u00e7ok sebebi olabilir,<\/p>\n<p>1. Yaz\u0131l\u0131m<br \/>\nYaz\u0131l\u0131m taraf\u0131nda bulunan genellikle d\u0131\u015far\u0131dan \u00e7a\u011fr\u0131lan isteklerden kaynakl\u0131 olarak bu problem ile kar\u015f\u0131la\u015fabilirsiniz.<\/p>\n<p>Nedir d\u0131\u015far\u0131dan \u00e7a\u011fr\u0131lan istekler<br \/>\nA- \u00d6rne\u011fin siteniz de hava durumu, yol durumu, d\u00f6viz durumu, namaz saatleri, 3.parti reklamlar (JS) vs. gibi bir ba\u015fka siteden \u00e7a\u011fr\u0131lan dosyalar komutlar var ise, kar\u015f\u0131 sitenin ge\u00e7 yan\u0131t vermesi veya ula\u015f\u0131lam\u0131yor olmas\u0131 bu hatay\u0131 alman\u0131za sebep olabilir.<\/p>\n<p>B- MySQL veritaban\u0131 lokal sunucudan ayr\u0131 bir yerde ise, eri\u015fimde problem ile kar\u015f\u0131la\u015f\u0131labilir.<\/p>\n<p>C- Bu hata, <a href=\"https:\/\/sunucucozumleri.com\/blog\/frontpage\/\">sunucu<\/a> ge\u00e7ersiz bir dosyaya eri\u015fmek istedi\u011finde olu\u015fabilir. \u00c7ekilen site timeout&#8217;a d\u00fc\u015f\u00fcyor olabilir.<\/p>\n<p>D- Ba\u011fland\u0131\u011f\u0131n\u0131z sunucu zincirdeki ba\u015fka bir sunucuya eri\u015fmeye \u00e7al\u0131\u015ft\u0131\u011f\u0131nda, zincirdeki bir sonraki sunucu iste\u011fi yerine getiremedi\u011finde veya ge\u00e7ersiz bir yan\u0131t verdi\u011finde 502 k\u00f6t\u00fc a\u011f ge\u00e7idi hatas\u0131 olu\u015fur.<\/p>\n<p>E- \u00c7erezlerinizi temizleyin ve ard\u0131ndan web sayfas\u0131na gidin.<\/p>\n<p>F- PHP programlama hatalar\u0131 nedeniyle 502 hata \u00fcretiyor olabilir.<\/p>\n<p>G- 502 hatas\u0131n\u0131n taray\u0131c\u0131 t\u00fcr\u00fcn\u00fczden ya da kaydedilen bir sayfadan kaynaklanmas\u0131 durumunda tamamen \u00f6nbellek bo\u015falt\u0131lamad\u0131\u011f\u0131ndan dolay\u0131 olabilir.<\/p>\n<p>H- DNS&#8217;yi temizlemeniz gerekebilir.<\/p>\n<p>I- Sunucunuzda Firewall &#8211; G\u00fcvenlik duvar\u0131 varsa engelliyor olabilir.<\/p>\n<p><strong>\u00c7\u00f6z\u00fcm \u00d6nerileri,<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u0130lgili hatan\u0131n giderilebilmesi i\u00e7in bizim de\u011finece\u011fimiz nokta sunucu taraf\u0131nda nginx.conf dosyas\u0131na yap\u0131lacak m\u00fcdehale \u015feklinde olacakt\u0131r. Ancak d\u0131\u015far\u0131dan \u00e7a\u011fr\u0131lan dosyalar\u0131 kontrol etmeniz ve yaz\u0131l\u0131mda bulunan bu tip hatal\u0131 i\u015flemleri gidermeniz gerekmektedir.<\/p>\n<pre>nano -w \/etc\/nginx\/nginx.conf\r\n<\/pre>\n<p>dosyas\u0131n\u0131 a\u00e7arak a\u015fa\u011f\u0131da bulunan de\u011feleri y\u00fckseltelim, E\u011fer ilgili komutlar yoksa ekleyip kaydederek \u00e7\u0131kal\u0131m.<\/p>\n<pre>proxy_buffer_size 128k;\r\nproxy_buffers 4 256k;\r\nproxy_busy_buffers_size 256k;\r\n\r\n<\/pre>\n<p>ilgili komutlar\u0131 ekledikten sonra,\u00a0<strong>service nginx <a href=\"https:\/\/sunucucozumleri.com\/blog\/reboot-ve-restart-arasindaki-farklar-nedir\/\">restart<\/a><\/strong>\u00a0komutu ile nginx servisini yeniden ba\u015flatal\u0131m.<\/p>\n<p>Not : \u0130lgili i\u015flem ile sadece sunucuda nginx de\u011ferlerini y\u00fckseltmi\u015f olduk, yaz\u0131l\u0131m\u0131n\u0131z\u0131 mutlaka kontrol ederek, en iyi derecede optimize etmeye, ettirmeye \u00e7al\u0131\u015f\u0131n\u0131z.<\/p>\n<p>Bol trafikler dileriz.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Merhabalar, Bug\u00fcn bilgi bankam\u0131za ekleyece\u011fimiz makalemizde &#8220;502 Bad Gateway Nginx&#8221; hatas\u0131n\u0131n \u00e7\u00f6z\u00fcm\u00fcne de\u011finece\u011fiz. \u00d6ncelikle\u00a0502 Bad Gateway\u00a0ve\u00a0504 Gateway Time-out\u00a0hatalar\u0131 genellikle \u00e7ok kar\u0131\u015ft\u0131r\u0131l\u0131r. Genel anlamda benzerlik ta\u015f\u0131sada birbirinden ay\u0131ran en \u00f6nemli \u00f6zellik, 502 Bad Gateway d\u0131\u015far\u0131dan \u00e7a\u011fr\u0131lan dosyalar, 504 Gateway Time-out ise yaz\u0131l\u0131m da bulunan hatal\u0131 kodlama sebebiyle kar\u015f\u0131m\u0131za \u00e7\u0131kmaktad\u0131r. 502 Bad Gateway Nginx hatas\u0131 alman\u0131z\u0131n bir &hellip;<\/p>\n","protected":false},"author":1,"featured_media":1456,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-717","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"acf":[],"_links":{"self":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/posts\/717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/comments?post=717"}],"version-history":[{"count":0,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/posts\/717\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/media\/1456"}],"wp:attachment":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/media?parent=717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/categories?post=717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/tags?post=717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}