---
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-09-02T23:56:07.751Z"
---

Every SEO module needs your site URL - sitemaps, OG images, [Schema.org](http://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 [nuxt.config.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

| Option          | Purpose                                                  | Default              |
| --------------- | -------------------------------------------------------- | -------------------- |
| `url`           | Canonical site URL (required for SEO)                    | Auto-detected in dev |
| `name`          | Site name for meta tags, [Schema.org](http://Schema.org) | -                    |
| `description`   | Default meta description                                 | -                    |
| `defaultLocale` | Language code (e.g., `en`)                               | Auto from i18n       |
| `indexable`     | Allow search engine indexing                             | `true` in production |
| `trailingSlash` | URLs end with `/`                                        | `false`              |

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.
::

## Reading Site Config

Access your config anywhere with `useSiteConfig()`{lang="ts"}:

```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 [nuxt.config.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.