---
title: "Understanding Site Config"
description: "Site Config shares your site URL, name, and metadata across all SEO modules. Set it once, use it everywhere."
canonical_url: "https://nuxtseo.com/docs/nuxt-seo/guides/site-config"
last_updated: "2026-05-25T15:21:46.862Z"
---

Every SEO module needs your site URL - sitemaps, OG images, Schema.org identifiers. Site Config lets you set it once instead of duplicating config across modules.

## Quick Setup

For most sites, add this to `nuxt.config.ts`:

```ts
export default defineNuxtConfig({
  site: {
    url: 'https://example.com',
    name: 'My Site'
  }
})
```

That's it. All modules now know your canonical URL and site name.

## Available Options

<table>
<thead>
  <tr>
    <th>
      Option
    </th>
    
    <th>
      Purpose
    </th>
    
    <th>
      Default
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        url
      </code>
    </td>
    
    <td>
      Canonical site URL (required for SEO)
    </td>
    
    <td>
      Auto-detected in dev
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      Site name for meta tags, Schema.org
    </td>
    
    <td>
      -
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        description
      </code>
    </td>
    
    <td>
      Default meta description
    </td>
    
    <td>
      -
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        defaultLocale
      </code>
    </td>
    
    <td>
      Language code (e.g., <code>
        en
      </code>
      
      )
    </td>
    
    <td>
      Auto from i18n
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        indexable
      </code>
    </td>
    
    <td>
      Allow search engine indexing
    </td>
    
    <td>
      <code>
        true
      </code>
      
       in production
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        trailingSlash
      </code>
    </td>
    
    <td>
      URLs end with <code>
        /
      </code>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
  </tr>
</tbody>
</table>

See [full config reference](/docs/site-config/api/config) for all options.

## Environment-Specific Config

Running staging or preview environments? Use environment variables so each deployment gets the right URL:

```bash
# .env.staging
NUXT_SITE_URL=https://staging.example.com
NUXT_SITE_ENV=staging
```

```bash
# .env.production
NUXT_SITE_URL=https://example.com
NUXT_SITE_ENV=production
```

Non-production environments are automatically blocked from indexing.

<tip>

Non-production environments are automatically blocked from indexing via the robots module. No need to manually configure `noindex` for staging or preview deployments.

</tip>

## Reading Site Config

Access your config anywhere with `useSiteConfig()`:

```vue
<script setup lang="ts">
const site = useSiteConfig()
// site.url, site.name, site.description, etc.
</script>
```

Works in components, composables, and server routes.

## Multi-Tenancy

Serving multiple domains from one Nuxt app? Site Config handles this:

```ts
export default defineNuxtConfig({
  site: {
    multiTenancy: [
      {
        hosts: ['example.com', 'www.example.com'],
        config: { name: 'Example', url: 'https://example.com' }
      },
      {
        hosts: ['foo.com', 'www.foo.com'],
        config: { name: 'Foo', url: 'https://foo.com' }
      }
    ]
  }
})
```

The correct config loads based on the incoming request hostname.

See the [Multi-Tenancy guide](/docs/site-config/guides/multi-tenancy) for runtime configuration.
