Skip to content

Best Practice: Starlight living as a proxied subdirectory #1763

Answered by delucis
brob asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @brob — good question!

I think for a case like this I would recommend setting Astro’s base config option to the proxied path, so something like:

import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';

export default defineConfig({
  base: '/docs/',
  integrations: [
    starlight({
      title: 'My delightful docs site',
    }),
  ],
});

This will apply in both cases, so when running the local project everything will also be prefixed with /docs/. I wasn’t clear from the description if that would be an issue. If it’s only for local development, I guess it wouldn’t be an issue if you need to navigate to /docs/ instead of / to see the site.

base will take…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@brob
Comment options

@delucis
Comment options

@brob
Comment options

@HiDeoo
Comment options

@delucis
Comment options

Answer selected by brob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants