How do I fix NGINX 502 Bad Gateway?
How to Fix a 502 Bad Gateway Error
- Reload the page.
- Look for server connectivity issues.
- Check for any DNS changes.
- Sift through your logs.
- Fix faulty firewall configurations.
- Comb through your website’s code to find bugs.
- Contact your host.
How do I fix 502 Gateway Timeout?
You can fix this error from your side by doing the following steps.
- Clearing cache of the web browser.
- Delete your browser’s cookies.
- Start your browser in Safe Mode.
- Try another browser.
- Restart your computer.
- Restart your networking equipment such as modem, router, switches.
Why is my 502 Bad Gateway NGINX?
A 502 Bad Gateway Error means that the web server you’ve connected to is acting as a proxy for relaying information from another server, but it has gotten a bad response from that other server. It’s possible the server is overloaded or there are network issues between the two servers, and it’s just a temporary problem.
What is the error 502 bad gateway?
The HyperText Transfer Protocol (HTTP) 502 Bad Gateway server error response code indicates that the server, while acting as a gateway or proxy, received an invalid response from the upstream server.
How do I fix Error 502 Gateway?
Troubleshoot a 502 error message
- Refresh the page.
- Start a new browser session or load the site on a different browser.
- Restart your computer and networking equipment.
- Clear your cache and cookies.
- Change your DNS server.
- Contact the website administrator or your internet service provider.
How do I get rid of error 502?
Why is my Nginx server saying 502 Bad Gateway?
Maintaining a server is hard. You have to deal with all the upgrades, security patches and the occassional server errors (aka errors from hell). One such common error in Nginx servers is “ 502 Bad Gateway “. 3 word error message – because Nginx doesn’t love you. That’s why. The error message is cryptic.
What is the default timeout for Nginx for PHP?
The default NGINX timeout is 60 seconds; if you’ve raised your PHP-FPM timeout above 60 seconds, NGINX will return a 504 Gateway Timeout error if your PHP application hasn’t responded in time. You can prevent this by also raising your NGINX timeout.
What is an HTTP status code error in Nginx?
Such type of error is referred to as an HTTP Status Code Error. It generally occurs at the gateway. Where gateway is an access point, a bridge communicates between the two servers. In this case, the gateway can be a service or application that is working and receiving requests from Nginx web server.
Why is my Nginx not responding to PHP-FPM?
If NGINX is unable to communicate with PHP-FPM for any of these reasons, it will respond with a 502 error, noting this in its access log ( /var/log/nginx/access.log) as shown in this example: NGINX’s access log doesn’t explain the cause of a 502 error, but you can consult its error log ( /var/log/nginx/error.log) to learn more.