Skip to content

Admin site always fetches from localhost #12418

@thasmin

Description

@thasmin

Bug report

Describe the bug

The admin site always tries to fetch localhost:1337/admin/project-types, even after the url is set in config/server.js.

Steps to reproduce the behavior

  1. Install strapi on new server with npx create-strapi-app@latest strapi.
  2. Configure DNS so a hostname points to the server.
  3. Add a url key in config/server.js with the hostname.
  4. Start server with npm run develop.
  5. Navigate to site, click on the button to set up the administrator user
  6. See error, open devtools to see broken API call to localhost:1337

Expected behavior

XHR call goes to hostname configured in config/server.js

Screenshots

It has a red triangle instead of a form.

Code snippets

System

  • Node.js version: v16.13.2
  • NPM version: 8.1.2
  • Strapi version: 4.0.7
  • Database: sqlite
  • Operating system: Ubuntu 20.04

Additional context

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