@nuxt/docs-nightly 5.0.0-29778218.1397500a → 5.0.0-29778449.c339b58d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -38,6 +38,20 @@ It respects the following runtime environment variables:
|
|
|
38
38
|
- `NITRO_HOST` or `HOST` (defaults to `'0.0.0.0'`)
|
|
39
39
|
- `NITRO_SSL_CERT` and `NITRO_SSL_KEY` - if both are present, this will launch the server in HTTPS mode. In the vast majority of cases, this should not be used other than for testing, and the Nitro server should be run behind a reverse proxy like nginx or Cloudflare which terminates SSL.
|
|
40
40
|
|
|
41
|
+
### Serving the Same Build at Multiple Paths
|
|
42
|
+
|
|
43
|
+
For a normal subpath deployment, set [`app.baseURL`](/docs/4.x/api/nuxt-config#baseurl) or the `NUXT_APP_BASE_URL` environment variable.
|
|
44
|
+
|
|
45
|
+
If a reverse proxy deliberately exposes the same rendered page at multiple public paths, Nuxt may replace the browser URL with the path used for server rendering during hydration. You can keep the browser URL by removing the rendered path from the payload in a server plugin:
|
|
46
|
+
|
|
47
|
+
```ts [app/plugins/preserve-proxy-url.server.ts]
|
|
48
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
49
|
+
delete nuxtApp.payload.path
|
|
50
|
+
})
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use this only when the proxy already handles assets and routing for every public path. Without the rendered path, Nuxt cannot correct a genuine mismatch between the requested URL and the server-rendered route.
|
|
54
|
+
|
|
41
55
|
### PM2
|
|
42
56
|
|
|
43
57
|
[PM2](https://pm2.keymetrics.io/) (Process Manager 2) is a fast and easy solution for hosting your Nuxt application on your server or VM.
|