-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
'astro': minor | ||
--- | ||
|
||
Adds a new option in the config called `server.allowedHosts` and CLI option called `--allowed-hosts`. | ||
|
||
This new options allows to specify the hostnames that the dev server and preview server are allowed to respond to | ||
|
||
```shell | ||
astro dev --allowed-hosts=foo.bar.example.com,bar.example.com | ||
``` | ||
|
||
```shell | ||
astro preview --allowed-hosts=foo.bar.example.com,bar.example.com | ||
``` | ||
|
||
```js | ||
// astro.config.mjs | ||
import {defineConfig} from "astro/config"; | ||
|
||
export default defineConfig({ | ||
server: { | ||
allowedHosts: ['foo.bar.example.com', 'bar.example.com'] | ||
} | ||
}) | ||
``` | ||
|
||
More information are available in the [vite documentation](https://vite.dev/config/server-options.html#server-allowedhosts). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters