# Nginx: nginx: [emerg] duplicate location "/" in /etc/nginx/sites-enabled/default:52

**Code:** `nginx: duplicate location` · **Category:** Nginx / Apache · **Seen on:** Nginx, Linux

Two `location` blocks with the same match exist in one server block (often from two included files).

## Meaning

Each exact location may appear once per server. The default site and your own file both define `location /`, or an included snippet repeats one. Remove/merge duplicates, or disable the default site (`rm /etc/nginx/sites-enabled/default`).

## Common causes

- Same `location` defined twice
- Default site and custom site both enabled for the same server_name
- Included snippets duplicate locations
- Copy-paste of config
- Regex location repeated

## Quick fix

1. Remove or merge the duplicate `location`
2. Disable unneeded default site
3. Use `nginx -T | grep -n "location /"` to find duplicates

## Detailed fix by platform

### Linux

1. `sudo nginx -T 2>/dev/null | grep -n 'location /'`

## How to diagnose

1. **Location** — Which pattern?
2. **Files** — Which include?
3. **Default** — Enabled?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/nginx-apache/nginx-duplicate-location)
