Book Now
Advanced Technical SEO

servers

Use Web Servers like Nginx or Apache to Improve Your SEO

Haz clic aquí si quieres saber en que consiste servers de cara al SEO.

Categorías

Articles

Servers Focused on SEO

The world of servers is vast, but controlling and configuring servers, although complex, is a super useful skill for all kinds of technical improvements in Technical SEO.

With servers, we can:

And many more options that help us improve our daily tasks. For example, a migration without server control is doomed to failure.

On this page, you can learn all the intricacies of how to optimize servers for SEO. As you can see on this site, using servers as a tool to achieve better SEO results is not just overlooked, but something really powerful. So much so that there is a meta tag to try to emulate certain server configurations.

While it’s great to know what can be done, it’s even better to know how to do it, and like everything in SEO, it depends—in this case, it depends on which server software we are using.

Moreover, each type of server has characteristics that need to be taken into account. While there is a variety of server types (not to be confused with hosting providers), in this case, I will compare the two most popular servers on the internet, which, as you can see in the index of this post, can even be combined.

Usage of each server by percentage in 2023. Nginx and Apache dominate the market share with over 30%
Servers by usage in 2023. Source: w3tech.com

Apache

Apache was the most used server and is still the best known in the web world, with a large active community, great flexibility and extensibility, stability and maturity, and compatibility with virtually all operating systems.

Being the most used and having the most documentation, it is quite easy to find solutions to any problem.

The biggest disadvantage of Apache is usually its resource consumption and performance, due to the way it is configured.

Although one of the reasons for its lack of performance, it is also a relative advantage that it has the .htaccess file, which allows a wide variety of configurations to be applied immediately upon saving the file.

This is because with each request, it re-reads the code. That is the reason for both its advantage and disadvantage.

On this blog, you can find several Apache configurations to help you with SEO, including:

Nginx

Nginx is much faster and more efficient than Apache, although it does not have an .htaccess file; all configurations must be made in a file called nginx.conf, and the server must be reloaded for the configuration to take effect.

In summary, editing an .htaccess file in Nginx would not work. Unless Nginx is combined with Apache.

Apache and Nginx Combined

In recent years, a configuration that uses Nginx as a proxy and Apache as the server to handle additional rules has become popular. This is known as a reverse proxy configuration.

This aims to take the best of both worlds.

In this type of configuration, Nginx acts as a proxy in front of Apache, like a kind of filter. Web traffic first reaches Nginx, which, after basic processing, redirects it to Apache for further processing. In this configuration, Nginx handles main tasks such as managing incoming connections, load balancing, caching, and compression. Although it can also handle redirects, in this case, it is designed for more complex configurations to be done from Apache.

The reason for using this configuration is that it takes advantage of the performance and ability to handle large simultaneous requests while combining it with the versatility, flexibility, and advanced configuration modules that Apache offers, creating a highly configurable and scalable system (if well managed and without turning it into chaos).

This allows you to take advantage of the strengths of both servers and achieve a very efficient web environment. However, it raises questions among less experienced users about how .htaccess rules can work in Nginx.

How to Detect Which Server My Website Uses

To detect which server a website is using, there are several options.

First, experience and knowledge can help you inspect HTTP response headers (which you can learn in the Technical SEO Master by Asdrubal).

If that doesn’t work, tools like Wappalyzer or BuiltWith can help give you an idea through historical data. (Remember that you may sometimes encounter the case of combined Apache and Nginx).

For more advanced users, tools like nmap can be used to analyze open ports on a website and get a clue about what type of server is being used.

What Other Servers Exist

Servers are designed to host and deliver content on the internet, although limiting this functionality to servers alone would be inadequate because there are also cloud service providers that fulfill the same purpose and can be configured similarly, with the added benefit that cloud service providers offer a broader range of services (like an all-in-one) including computing, storage, and databases (things that a web server does not perform). Since these are substitute elements, I feel obliged to mention both. If we want to group both terms, we could define them as web infrastructure.

The real difference is that cloud service providers are servers that come with more features; it’s just something we have to keep in mind when analyzing the technology of a project.

Web Servers

A web server is software designed to host and deliver websites and web applications over the Internet. A web server is responsible for receiving client requests (web browsers) and sending them the corresponding responses, which are generally web pages or requested resources. Servers can serve static content such as HTML and CSS, as well as dynamic content, using server-side programming languages like PHP, Python, or Java.

Besides Apache and Nginx (which fall into this category), we may also encounter:

ISS

An acronym for Internet Information Services, this is the web server developed by Microsoft for Windows operating systems.

The way redirects are handled on this type of server and how meta tags like x-robots are applied is quite peculiar.

Redirect on ISS

Lighttpd

A lightweight, high-performance web server designed to be resource-efficient. It is scalable and flexible, with the ability to handle a large number of simultaneous connections, using much less memory and CPU compared to other well-known servers.

However, being less popular, it does not have as active a community as Apache or Nginx, making it more difficult to find solutions and resources. Adding to this, it has fewer modules and plugins, and its documentation is relatively poor, which can cause project stagnation.

Lighttpd’s operation is quite similar to Nginx. For example, to create a redirect, you would need to edit the lighttpd.conf file.

An example of a redirect might be:

$HTTP["host"] =~ "example.com" {
url.redirect = (
"^/directoryA/pageA.html$" => "https://domainb.com/directoryB/pageB"
)
status.redirect = 301
}

The code must always be placed inside $HTTP[“host”], and like Nginx, for optimization purposes, a server reset is required for it to work.

As always, I recommend testing redirects locally before implementing them on a website. A local environment can easily be created (from Windows) by downloading the win32-SSL.zip file from https://lighttpd.dtech.hu/. Running the LightTPD.exe file will activate the environment on localhost.

Caddy

A web server and reverse proxy with built-in automation and HTTPS encryption features. Like all known servers, it is fast and efficient, although its biggest strength is also its greatest weakness. It is designed to be simple, which gives it less flexibility.

Caddy allows inline configuration without the need to edit any .conf file, although it does have one, called Caddyfile.conf. Like Nginx and all modern servers designed for efficiency, the server must be restarted for the configurations to take effect.

A redirect might look like this:

example.com {
redir /directoryA/pageA.html /directoryB/pageB 301
}

Tomcat

A web server and servlet and JSP (JavaServer Pages) container developed by Apache.

It has Java support, ideal for websites developed in Spring. However, it requires a certain learning curve and familiarity with Java environments.

Other Servers

There are other lesser-known servers like JBoss or WebSphere, but to keep the post readable, I will only update or add extra content about this server world on demand.

Cloud Platform

Cloud platforms are generally intended for large, complex projects. They offer more types of services than web servers, but they also tend to be much more expensive, especially if a specialist is not hired to configure them.

Azure

Designed for the Windows environment, it is a fairly complete option developed by Microsoft.

Like all cloud platforms, it has a wide range of services, integration with the Microsoft ecosystem, flexibility, scalability, and robust security.

However, it has a quite extensive learning curve and uses a pay-as-you-go system, so costs are variable and can increase significantly.

If you want to perform redirects with Azure, you have to consider that it is a peculiar environment, but I created a tool to avoid complications in this regard.

AWS

Amazon Web Services is a cloud platform offered by Amazon that provides a wide range of services and tools for cloud computing.

Like Azure, it is quite scalable, with a wide range of services, but it also entails a huge learning curve, and costs can multiply significantly.

Google Cloud Platform

Google’s cloud platform that offers services for storage, processing, and deploying applications in the cloud. It has almost the same advantages and disadvantages as AWS and Azure.

IBM Cloud

IBM’s cloud platform that provides services and solutions for deploying applications and services in the cloud.

They are really four giant companies (Microsoft, Amazon, Google, and IBM) offering the same service, which tends to be quite powerful and quite expensive.

If you want to learn how to create redirects or if you want me to create a tool to facilitate them on any of these servers, you can request it through my Discord.

Bibliography

Interested in Advanced SEO Training?

I currently offer advanced SEO training in Spanish. Would you like me to create an English version? Let me know!

Tell me you're interested

Recommended Posts

Usamos cookies para asegurar que te damos la mejor experiencia en nuestra web. Aquí tienes nuestra política de privacidad.