content
content copied to clipboard
Hosting on Github pages (with .nuxt.space) causes MIXED CONTENT error
Environment
Github pages
Version
nuxt: 3.15.4 nuxt/content: 3.1.0
Reproduction
- Build with
npx nuxi build --preset github_pages - Host website on github pages.
- Github redirects (301) from
https://x.nuxt.space/api/content/content/database.sql?v=V4I9ATckytohttp://x.nuxt.space/api/content/content/database.sql/?v=V4I9ATckyKcausing a MIXED CONTENT error and the browser blocking the request.
I am not sure why github pages does this.
Description
Workaround
Add the following to nuxt.config.ts
app: {
head: {
meta: [
{
"http-equiv": 'content-security-policy',
content: 'upgrade-insecure-requests'
}
]
}
},
Additional context
No response
Logs
Try adding autoSubfolderIndex: false to nitro.prerender options.
export const defineNuxtConfig({
nitro: {
prerender: {
autoSubfolderIndex: false
},
}
})
This will prevent creating a directory for pre-rendered files, an should resolve the issue