Admin not working on GCP App Engine

System Information
  • Strapi Version: 4.0.4
  • Operating System: GCP App Engine / NodeJS
  • Database: Postgres
  • Node Version:
  • NPM Version:
  • Yarn Version:

I’ve spent the last 4 hours trying various ideas I’ve read both here and in the github issues but none have worked so far. I do the local build and then deploy to Google App Engine. The app loads just fine except when I try to load the admin, there are 2 resources that fail to load and prevent the entire app from loading. These errors show up in the console logs for chrome.

Error 1
Refused to connect to ‘http://localhost:1337/admin/project-type’ because it violates the following Content Security Policy directive: “connect-src ‘self’ https:”

Error 2
Refused to connect to ‘http://localhost:1337/admin/init’ because it violates the document’s Content Security Policy

I’ve tried setting:
server → url
server → port
admin → serveAdminPanel

I’ve also set these ENV values and validated that they exist in the deployment:
HOST: ‘0.0.0.0’
NODE_ENV: ‘production’
DATABASE_NAME: ‘xxxxx’
DATABASE_USERNAME: ‘xxxxx’
DATABASE_PASSWORD: ‘xxxxx’
INSTANCE_CONNECTION_NAME: ‘xxxxx’
JWT_SECRET: ‘xxxxx’
API_TOKEN_SALT: ‘xxxxx’
PUBLIC_URL: ‘xxxxx’
STRAPI_ADMIN_BACKEND_URL: ‘xxxx/admin’

** had to remove the “https” from the url in this topic due to not being able to put more than 2 links in the issue.

I’ve also made sure to build after making changes and before deploying.

Any suggestions? No matter what I’ve done, it keeps trying to make a connection to localhost:1337

1 Like

Hi, did you find the answer? stuck at the same place with Azure VM.
Thanks :slight_smile:

Not yet. Moving on to something else.

Hi Donald,

dou you have find out a solution for this issue?

No, ended up hosting with Digital Ocean instead.

Hi Donald,
I’m having the same issue deploying i a droplet. How didi you solved?