Skip to main content
← All guides

Fix Nuxt “Blocked request. This host is not allowed”

Why qURL here

Keep the app private on your machine and invite the people you choose by email: each verifies their address and saves a passkey, with no account needed, and comes back until you revoke them. One .qurl.site entry under vite.server covers everyone you let in. For a quick look, send a one-time qURL™ link instead.

See how LayerV compares to ngrok →

Steps

Nuxt’s Vite-based dev server blocks unknown hosts. Add the tunnel domain, such as .qurl.site, to vite.server.allowedHosts in nuxt.config.ts. Nuxt has no top-level allowedHosts option. Avoid nuxt dev --public, which disables the check. With qURL, share the running Nuxt app through single-use links with no public URL.

  1. Read the host from the error

    Once the app has built, the page answers 403 with Vite’s message, which names vite.config.js even in a Nuxt project. While Nuxt is still building, its loading page answers instead: “Forbidden: this host is not allowed. Pass it to --host, or --public to allow any host.”

  2. Add the tool’s domain under vite.server.allowedHosts

    nuxt.config.ts passes its vite key straight to Vite. A leading dot allows the domain and every subdomain: .qurl.site for qURL, your exact dev domain for ngrok, .trycloudflare.com for a Cloudflare Quick Tunnel. Nuxt applies the change without a restart.

    // nuxt.config.ts (merge into your existing config)
    export default defineNuxtConfig({
      vite: { server: { allowedHosts: ['.qurl.site'] } },
    })
  3. Share it through qURL

    Restart nuxt dev with --host 127.0.0.1, then publish that loopback address from a second terminal as shown. Your app stays on this computer; nothing listens on your network. Each qurl share link opens once and expires within 24 hours.

    qurl publish http://127.0.0.1:3000
    qurl share <CRID>

What the recipient sees

With the domain allowed, the app loads through the link and hot reload connects.

Troubleshooting

Troubleshooting
If you seeDo this
“Forbidden: this host is not allowed” while the app is still buildingThat is Nuxt’s loading page, before Vite takes over. Wait for the build to finish and reload; if Vite then answers “Blocked request”, add the domain as above. Don’t reach for --public: it turns the host check off.
qurl publish says the local app is not accepting TCP connectionsStart the app first and check that curl works on the same address. qurl publish connects to localhost as 127.0.0.1, so if your app listens only on IPv6 (on macOS or Linux, lsof -iTCP -sTCP:LISTEN -nP shows [::1]), publish 'http://[::1]:PORT' instead, or start the dev server with --host 127.0.0.1 and publish that address. Neither requires listening on your LAN. Keep the quotes: zsh treats the brackets as a pattern.
Show 5 more fixes
More troubleshooting
If you seeDo this
The recipient sees “Access link invalid”The link was already used or has expired. Run qurl share again and send the new link.
The recipient sees “Resource not found”The resource was deleted after the link was made. Publish the app again, then run qurl share and send the new link.
publish rejects http://127.0.0.1 with “only HTTPS URLs are allowed”, asks you to log in, or prints no Access: lineYour qURL CLI is out of date. On macOS run brew update, then brew upgrade qurl; elsewhere install the latest release. After updating, qurl --version prints 3.4.1 or later, and every publish is private by default.
publish says this Linux session “can’t reach a systemd user manager”You are in a container or sandbox without a user service manager. Run qurl publish with --foreground; sharing lasts as long as that process runs. Container and CI setup →
publish says “Quota Exceeded” with “protected resource limit reached”, or “Your qURL account has reached a plan limit”You can see this without an account: a device with no account can keep up to 3 active resources, with links that last up to 24 hours. Run qurl list --status active, then qurl delete <CRID> for any you no longer need (it asks you to confirm; --yes skips that). qurl stop keeps the resource, so it does not free a slot.

Frequently Asked Questions

Why not use nuxt dev --public?

In the @nuxt/cli source, --public sets Vite’s allowedHosts to true and allows any origin, which turns the host check off. Vite’s docs warn that this lets any website reach your dev server through DNS rebinding. List the domains you need instead.

Does Nuxt have its own allowedHosts option?

No. Its devServer options cover https, port, host, url, the loading template and CORS, not allowed hosts. The vite key in nuxt.config.ts is the place.

Who else can reach my app while the link is open?

Opening the link starts a session for that browser, which lasts 1 hour by default. After a browser opens it, another browser on the same public IP cannot use its access. A script or agent that opens the link without a browser is admitted by its network address instead, which other devices on that public IP share until the session ends. A link admits whoever opens it: the API’s IP and country rules do not apply to the signed links qurl share issues. Keep your app’s own sign-in for anything sensitive.

Publish your app now

Install the CLI, then run one command. No sign-up, no API key.

Install the CLI →

Book a pilot

Tell us what to hide. We’ll scope a pilot.

Enterprise starts with a paid pilot on one application, typically 60 to 90 days, credited in full toward year one if you convert within 60 days. After that, an annual package sized to what you protect, not per seat.