The Simplest Explanation of a 502 Bad Gateway Error & How to Resolve It

Troubleshooting a 502 Bad Gateway Error is like solving a mystery. You don’t know what exactly happened or why — all you know is that something’s wrong and you need to fix it.

Improve your website with effective technical SEO. Start by conducting this  audit.  

To guide you through the hassle of fixing the dreaded 502 Bad Gateway Error, let’s go over what it exactly is and its most common causes and solutions.

502 bad gateway error

Picture Credit: Arm Mbed OS

Fortunately, there are five common and effective solutions for fixing most of the causes of a 502 Bad Gateway Error.

1. Look for server connectivity issues.

Most websites live on multiple servers or third-party hosting providers. If your server is down for maintenance or any other reason, your website could serve visitors a 502 Bad Gateway Error page. The only way to troubleshoot this issue is to wait for your server to finish maintenance or fix the problem causing the error.

2. Check for any DNS changes.

If you’ve recently changed host servers or moved your website to a different IP address, it’ll make changes to your website’s DNS server. This could cause your website to serve its visitors a 502 Bad Gateway Error page. Your website won’t be up and running until these DNS changes take full effect, which can take a few hours.

3. Sift through your logs.

Server logs will provide details about your server’s health and status. Sift through them to uncover any alarming information.

4. Fix faulty firewall configurations.

Your firewall is your website’s gatekeeper, protecting your site from malicious visitors or distributed denial-of-service (DDoS) attacks. Sometimes, a faulty firewall configuration will cause your firewall to deem requests from a content delivery network as an attack on your server and reject them, resulting in a 502 Bad Gateway Error. Check your firewall configuration to pinpoint and fix the issue.

5. Comb through your website’s code to find bugs.

If there’s a mistake in your website’s code, your server might not be able to correctly answer requests from a content delivery network. Comb through your code to find bugs or copy your code into a development machine. It’ll perform a thorough debug process that will simulate the situation that your 502 Bad Gateway Error occurred in and allow you to see the exact moment where things went wrong. 

Improve your website with effective technical SEO. Start by conducting this  audit.  

Anchor Text: The Short & Sweet Guide

When’s the last time you thought about the specific text you hyperlink in order to direct readers to another page on your website? This text, known as anchor text, doesn’t get much attention. But if done right, it can bolster your SEO efforts.

Optimizing your anchor text, the clickable, hyperlinked text on your website, might sound like a trivial tactic. But linking internally — also called “inlinking” — to related pages on your website can actually boost your rankings on Google if you anchor these links to words and phrases that relate to the pages you’re linking to.Improve your website with effective technical SEO. Start by conducting this  audit.  

“Inlinking with clear, concise, and relevant anchor text can reinforce the topical connection between certain posts in Google’s eyes and help all of those posts rank better,” says Braden Becker, HubSpot’s Historical Optimization Lead.

With this in mind, anchor text is nothing to gloss over. It’s a small detail that’s easy to overlook, but it’s still important in today’s SEO landscape. If you want to learn more about what exactly anchor text is, why it’s important, and the different types of anchor text, read on.

To clearly inform search engines and users about the topic of the page you’re linking to, your anchor text should be succinct, specific, pertinent to the destination page, and in close proximity to a keyword you want your pages to rank well for on Google.

That’s right — anchor text doesn’t have to include a keyword — it can just sit in a sentence that includes your target keyword. We’ll talk more about this in a minute.

When you anchor links to descriptive words and phrases, Google’s bots can instantly understand what the linked page is about. A clear connection between your page’s topic to the linked page’s topic can also help both pages rank for queries related to the topic.

But stuffing keywords or using the same exact keywords in all your anchor text will make Google suspect that you’re just trying to rank for those keywords, rather than linking internally to relevant information, and they’ll penalize you for it.

Anchor Text Examples

Some types of anchor text are better than others. Here are the four most common types, ranked by quality.


Anchor text is a partial match if it includes a variation of the keyword that describes the linked page’s topic. It clearly informs Google about the page’s topic, especially if there are keywords related to the page’s topic in the anchor text. Not having to worry about getting an exact match with your anchor text and a page’s topic also allows you to write your content as naturally as possible.

An example of anchor text that’s a partial match is “Every SEO should know the importance of domain authority” — the linked page covers what domain authority is, why it’s important, and how to improve it, and the anchor text can convey that message, without explicitly stating it.


Anchor text is an exact match if it includes the exact keyword that describes the linked page’s topic. Just like a partial-match, exact matches also clearly inform Google about the linked page’s topic. But if you anchor your internal links to too many keywords that are exact matches, Google could suspect you’re just trying to rank for those exact keywords rather than providing value to your readers.

An example of anchor text that’s an exact match is “Check out this comprehensive guide about Google Search Console” — the linked page is called the “Ultimate Guide to Google Search Console in 2018”.


Generic anchor text is a common word or phrase, like “This blog post” or “Read more”. Google actually reads text surrounding anchor text when its bots crawl your web pages, so even if you anchor a link to a generic word or phrase, the surrounding text can still tell Google what the linked page is about. But Google can only know what the link is about if your generic anchor text is surrounded by text that clearly describes the linked page’s topic.


Spammy anchor text links to a webpage that has no relation to its hyperlinked keyword. These types of anchor text mislead users into thinking what the linked page is actually about, providing zero value to the user. The sole reason why people use spammy anchor text is to briefly rank for highly competitive keywords like insurance, loans, or mortgage and siphon traffic from those keywords’ SERPs.

People will also use spammy anchor text to hamper their competitors’ public perception on Google. For instance, a company could hyperlink their competitor’s website to the keyword “worst company to work for in 2018” in one of their blog posts, and their competitor’s website could potentially rank for “worst company to work for in 2018” on Google.

Even in 2018, Anchor text is still important.

Anchor text might be at the end of your to-do list when you’re polishing your blog post, but intentionally anchoring links to clear, concise, and relevant keywords can bolster your SEO efforts. Google will seamlessly understand the topic of each linked page on your website and grasp the topical connection between your posts, boosting your rankings.

Improve your website with effective technical SEO. Start by conducting this  audit.