← Back to the blog

What is a web server and how does it work?

Earlier in Ask Zotis, we talked about domain names and web hosting. Today we’re going a step further. What happens between typing an address and seeing the page on your screen?

What is a web server and how does it work?

If you type zotis.gr, your browser finds where to connect and sends a request for the home page. A program at the other end receives the request and sends a response. That program is the web server.

For a photo, the web server can send the file directly. For something more involved, like search results in an online shop, it passes the request to the shop’s application. The application finds the matching products and the web server returns the resulting page to your browser.

Where do Apache and Nginx fit in?

Apache and Nginx (pronounced “engine-x”) are two programs that do this job. Both can serve a website or pass requests to the application behind it. They can also work together. In one common setup, Nginx can serve images directly and forward requests for pages that need to be generated to Apache.

You can also host several websites on the same machine. The web server sees which domain the browser requested and uses that information to serve the right site.

If I have a website, does it matter which one I use?

If you have a hosting plan, your provider has usually set it up for you. If you run your own server or move an existing site, the choice matters. For example, if your redirects are written in an Apache .htaccess file, you’ll need to translate those rules into the Nginx configuration when you switch.

In short, the domain helps your browser find where to connect, hosting gives the site a place to live, and the web server responds when someone asks to see it.

Continue reading

Next guide · Business email on your own mail server or with a provider?

Have a technology question of your own? Send it to Ask Zotis.