

For example use one of the following tools or other similar ones:,.

To do this, use one of the tools that check the status of the site and whether it is working or not. You can check if only you have connection problems or if other people also cannot establish a connection to this website. However, there are times when the cause is in the user’s device. Most often, the 502 error occurs due to problems on the side of the website. You can see the 502 errors as well as the status of your NGINX server. This allows you to get the visualization into your NGINX that you need. To integrate NGINX with MetricFire, we use a Telegraf plugin. Using MetricFire to monitor NGINXĭid you know you can visualize your NGINX statuses with MetricFire? MetricFire ingests time-series metrics so as long as your metrics are sent in a format Graphite can ingest, MetricFire may be a great fit for you. The original server is down or there is no connection to this server. In this case, you need to change the DNS server and wait until the changes are propagated and become active globally. The domain name is not resolved to the specified IP address or all IP addresses. Some DDoS protection systems or security plugins of your CMS can also block requests from servers. To fix this problem, you can increase the PHP-FPM timeout, or you will have to research your application and figure out why it is not responding for too long.Ī firewall can block communication between the edge servers and the origin server. In this case, PHP-FPM closes the connection even before the response is sent, and NGINX returns a 502 error. If the server takes too long to respond, then a 502 error can be caused by a PHP-FPM timeout. If no PHP-FPM processes are displayed as a result of this command, then you need to run PHP-FPM to resolve error 502. If you are on Linux, you can check if PHP-FPM is running using the following command: ps aux | grep php-fpm The next reason for the 502 error is that PHP-FPM is not running. If in the response you see that the status is inactive (dead), then you need to start NGINX. To do this, run the following command: systemctl status nginx If you see error 502, you need to check if NGINX is running. Let’s take a look at some of the possible reasons for the 502 Bad Gateway. The use of separate services is very important to improve efficiency. Web requests are processed over a TCP/IP socket, NGINX only handles HTTP requests, and PHP-FPM interprets PHP code. PHP works as an isolated service if you are using PHP-FPM. PHP-FPM together with NGINX can significantly increase the performance of websites and reduce resource consumption at the same time.

PHP-FPM (PHP-FastCGI Process Manager) is a web request processing tool for PHP applications. Below we will look at the main ones, as well as possible ways to fix this error. For example:Īlso, the appearance of the page that displays the 502 error can be customized on different sites in the same way as it is done for the 404 not found error. There are different names for the 502 error that you can see on different sites. NGINX returns error 502 if it cannot connect to PHP-FPM or PHP-FPM is not responding. When connecting to another server, it returns an error. This happens when one server acts as a proxy to receive information from another server. MetricFire's platform can be used to monitor NGINX statuses, and its Telegraf plugin allows users to get visualizations of their NGINX server's status and 502 errors.ĥ02 Bad Gateway means that the server you are accessing receives an error from another server.To solve the error, website visitors can reload the page, clear the browser cache and delete cookies, try using a different browser, or restart the router.Some of the possible reasons for the error are non-running NGINX or PHP-FPM, firewall blocking requests, the domain name not being allowed, or the server being unavailable.The use of PHP-FPM with NGINX can improve the performance of websites and reduce resource consumption.NGINX Error 502 Bad Gateway is an error message that indicates the server is receiving an error from another server and cannot connect to PHP-FPM or PHP-FPM is not responding.
UPGRADE PHPMYADMIN NGINX ON MAC HOW TO
For getting more detailed information about MetricFire and how to integrate it with your system, book a demo with our team or sign up on MetricFire for the free trial. Use MetricFire's platform to analyze your system’s performance and troubleshoot errors. In this article, we will look at the main possible causes and how they can be solved by users and web developers. There are various possible reasons for this error and different ways to solve it. The NGINX Error 502 Bad Gateway is a common error among website users.
