views
504 Error Meaning
A 504 error means that a website took too long to respond to a request. When you visit a website, your browser makes a request to that website's server in order to display the page. If the website's server takes too long to respond to the origin web server (your browser), you'll get a 504 error code.
504 is what's known as an HTTP response status code. There are many of these codes ranging from 1xx to 5xx. 5xx codes indicate a server-side problem, which means a 504 error is most likely not the fault of the website user. Despite this, there are some fixes website users can try. You can read about them below. Website owners can check out some solutions in this article, too.
Fixes for Website Users
Refresh the page. The first thing to try is refreshing the page. The 504 error may be due to a random glitch, and refreshing the page can fix that error.
Check your network settings. If you use a proxy or a VPN, try temporarily disabling them. You may also want to check your firewall settings to ensure your settings aren't set too strictly. On Windows, search for "proxy" or "firewall" in the taskbar search bar to pull up your proxy or firewall settings. You can also search for "network troubleshooter" to use the built-in troubleshooter to fix any network issues. On Mac, open the Apple menu and go to System Settings > Network. Choose either Proxies or Firewall to edit these settings. If you have a VPN, each VPN program will be set up slightly differently. Open your VPN program and look for an option or toggle to turn it off.
Flush your DNS cache. If your network settings seem normal, you can try flushing your DNS cache. This can resolve some network connectivity issues, and will remove old, bad, and corrupt data from your DNS cache. Windows: Search "cmd" in the taskbar search bar, then right-click Command Prompt and select Run as administrator. Then, type ipconfig /flushdns and press ↵ Enter to flush your DNS. Mac: Press ⌘ Cmd+Space and search for the Terminal app, then open it. Type sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. Press ⏎ Return and enter your admin password.
Restart your router and/or modem. If you're getting 504 errors on every site, the problem may be with your network devices. Unplug your router and/or modem from the wall for at least 30 seconds, then plug it back in. Once your internet connection is restored, try accessing the site again. Many people have combination routers and modems, so you'll only need to unplug one device.
Restart your computer. If restarting your router and/or modem doesn't fix the issue, you can try restarting your entire computer. While it may not seem like it, restarting your computer can fix a whole host of seemingly random issues, including network issues that cause problems accessing websites.
Wait it out. If nothing else works, then the issue is likely server-side and must be fixed by the website owner. If you're able to access other webpages on the site or you know the website's contact info, you can contact the site to report the error. You can also check with your ISP to see if the issue is on their end.
Fixes for Website Owners
Check your DNS propagation. If you recently transferred your website to a different server, your domain's DNS may not be propagated fully yet. Use https://dnschecker.org to see if your site's DNS is propagated. You may want to also check your domain's DNS settings to ensure there's no errors.
Disable your CDN. If you use a CDN like Cloudflare, you may want to try temporarily disabling it if you're encountering 504 errors on your site. The CDN could be causing the error by not giving a timely response to the origin server's request.
Check for spam or DDoS attacks. If your website is being spammed by malicious bots, it can lead to all visitors getting a 504 error. Check your site's access logs to see if there's an influx of suspicious IPs visiting your site, then block them. If you encounter a lot of DDoS attacks, consider using DDoS protection. Many cloud services offer DDoS protection, including Cloudflare, Amazon Web Services, and Microsoft Azure.
Extend your API request timeout limit. If you're using NGINX, you may be encountering 504 errors due to your API calls taking too long to complete. If this is the case, you can extend your API request timeout limit. Go to /etc/nginx/sites-available/default or /etc/nginx/nginx.conf. Add the following: proxy_connect_timeout 240; proxy_send_timeout 240; proxy_read_timeout 240; send_timeout 240; Run sudo nginx -t to check syntax. Run sudo service nginx restart.
Common 504 Error Messages
There are a number of error messages you might see for a 504 error. 504 error messages do not always have the same wording. However, the message should say "504" somewhere in the error. These are some of the common error messages you might see when you're encountering a 504 error: 504 Error 504 Gateway Timeout 504 Gateway Timeout NGINX Gateway Timeout Error Gateway Timeout (504) HTTP 504 HTTP Error 504 - Gateway Timeout
Comments
0 comment