# Server configuration

Category: [Technical SEO](https://seo-geo-glossary.com/en/glossary/category/technical-seo/) › [Servers, HTTP & caching](https://seo-geo-glossary.com/en/glossary/category/technical-seo/servers-http-caching/) · Also known as: Nginx/Apache

**Server configuration**, in an SEO context, means the settings of a web server such as nginx or Apache that decide how requests are answered. These settings determine redirects, status codes, HTTP headers and which URLs are served at all.

## Why does server configuration matter for SEO?

Search engines see the result of the configuration: the status code, the headers and the redirect target. A wrong rule can send a whole site to a 404 or 500 page, or create redirect chains that go unnoticed in the CMS.

Nginx reads its settings from a main file named `nginx.conf`, commonly located in `/etc/nginx/`. Inside it, `server` blocks define the domain and port, and `location` blocks define how matching URLs are handled. After an edit, `nginx -s reload` applies the new configuration without downtime, and a configuration with a syntax error is not applied.

Apache can be configured centrally or through `.htaccess` files in single directories. The Apache project recommends the central configuration where possible, because `.htaccess` files are read on every request. Nginx has no equivalent of `.htaccess`.

## Example

A permanent redirect from HTTP to HTTPS in nginx:

```nginx
server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://example.com$request_uri;
}
```

For single URLs, the `rewrite` directive with the `permanent` flag returns a 301:

```nginx
rewrite ^/old-page$ /new-page permanent;
```

## Common mistakes

- Redirect rules that conflict, producing loops or chains.
- Using `redirect` (302) where a permanent move needs `permanent` (301).
- Setting headers such as `X-Robots-Tag` on the wrong `location`, so they miss part of the site.
- Editing the live configuration without testing it first.

## Related terms

- [.htaccess](https://seo-geo-glossary.com/en/glossary/htaccess/index.md)
- [301 redirect](https://seo-geo-glossary.com/en/glossary/301-redirect/index.md)
- [X-Robots-Tag](https://seo-geo-glossary.com/en/glossary/x-robots-tag/index.md)
- [Server response time](https://seo-geo-glossary.com/en/glossary/server-response-time/index.md)
- [5xx server errors](https://seo-geo-glossary.com/en/glossary/5xx-server-errors/index.md)

## Sources

- [Beginner's Guide – nginx.org](https://nginx.org/en/docs/beginners_guide.html)
- [Module ngx_http_rewrite_module – nginx.org](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html)
- [Apache HTTP Server Tutorial: .htaccess files](https://httpd.apache.org/docs/current/howto/htaccess.html)
- [Robots meta tag and X-Robots-Tag – Google Search Central](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)

---

Last updated: October 7, 2026
URL: https://seo-geo-glossary.com/en/glossary/server-configuration/
