blocked request with 403 Forbidden
mparisi76
HOBBYOP

a year ago

Hello. I get the following response when I try to access my app:

To allow this host, add "railway-backend-production.up.railway.app" to `server.allowedHosts` in vite.config.js.```
Where does this vite.config.js live and how to I access/edit this file?
Solved$10 Bounty

Pinned Solution

root101
HOBBY

a year ago

That looks like a cors config is missing.

You need to have something like this:

// vite.config.js
export default defineConfig({
  //more configs
  server: {
    allowedHosts: [
      'railway-backend-production.up.railway.app'
    ]
  }
});

3 Replies

mparisi76
HOBBYOP

a year ago

eff4fdbb-16e0-4ffb-bee2-4ad13f2f307e


a year ago

Should be in your project's root directory.


root101
HOBBY

a year ago

That looks like a cors config is missing.

You need to have something like this:

// vite.config.js
export default defineConfig({
  //more configs
  server: {
    allowedHosts: [
      'railway-backend-production.up.railway.app'
    ]
  }
});

Status changed to Solved chandrika 11 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...