Skip to content

Strapi admin page will not load when using a non-default URL #10285

@AugustZellmer

Description

@AugustZellmer

Bug report

Describe the bug

Strapi admin page will not load when using a non-default URL. The spinner just spins forever. There are no errors.

Steps to reproduce the behavior

Add a relative URL to the server.js file, kinda like this:

module.exports = ({ env }) => ({
  host: env('HOST', '0.0.0.0'),
  port: env.int('PORT', 1337),
  url: env('URL', '/cms'),
  admin: {
    auth: {
      secret: env('ADMIN_JWT_SECRET', '2380253secretKey23505901'),
    },
  },
});

Rebuild Strapi using npm run build --clean.
Launch Strapi (if it didn't already launch itself after the build).
Navigate to https://localhost:1337/cms/admin.

Expected behavior

The admin page loads.

Actual behavior

The page loads, but the spinner spins forever and the login form never shows. The logs have no errors, they just say

[2021-05-10T20:54:26.390Z] debug GET /cms/admin/runtime~main.6b4d830a.js (5 ms) 200
[2021-05-10T20:54:26.390Z] debug GET /cms/admin/main.0ba3adc6.chunk.js (1 ms) 200
[2021-05-10T20:54:26.810Z] debug GET /cms/admin/init (1 ms) 200
[2021-05-10T20:54:26.876Z] debug GET /favicon.ico (1 ms) 200

System

  • Node.js version: 14.16.1
  • NPM version: 6.4.12
  • Strapi version: 3.6.1
  • Database: postgres
  • Operating system: Ubuntu and Google Cloud Platform

Additional context

Removing the URL specification from the server.js file fixes the problem, but I need that URL to be there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions