Skip to content

FetchError: request to custome admin url failed, reason: getaddrinfo ENOTFOUND #8501

@geekplux

Description

@geekplux

Bug report

Describe the bug

I tried to deploy by following https://strapi.io/documentation/v3.x/deployment/nginx-proxy.html, no matter what solution I used (Sub-Folder Unified or Sub-Folder Split) I still got error below:

Create your first administrator 💻 by going to the administration panel at:
https://custom_url.com/xadmin
FetchError: request to https://custom_url.com/xadmin failed, reason: getaddrinfo ENOTFOUND custom_url.com
at ClientRequest. (/home/userxxx/project-backend/node_modules/node-fetch/lib/index.js:1455:11)
at ClientRequest.emit (events.js:314:20)
at TLSSocket.socketErrorListener (_http_client.js:428:9)
at TLSSocket.emit (events.js:314:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
type: 'system',
errno: 'ENOTFOUND',
code: 'ENOTFOUND'
}

the nginx.conf and config/server.js are same as the example which you provided. After a digging through the doc I didn't find anything other options I can attempt to fix this error. Much appreciated if you can figure out or give some tips.

Steps to reproduce the behavior

  1. Quick start according to docs
  2. change url or admin url in config/server.js
  3. config the nginx proxy
  4. run and get error

Expected behavior

No error if there is custom url.
(it's actually no error now if I drop all the url changing)

Screenshots

If applicable, add screenshots to help explain your problem.

Code snippets

config/server.js

module.exports = ({ env }) => ({
  host: env('HOST', '0.0.0.0'),
  port: env.int('PORT', 1337),
  // url: 'https://customurl.com/api',
  admin: {
    // url: 'https://customurl.com/xadmin',
    auth: {
      secret: env('ADMIN_JWT_SECRET', '1e978b20a8532605b42d18bf01ea37f4'),
    },
  },
});

System

  • Node.js version: 12.19.0
  • NPM version: 6.14.8
  • Strapi version: 3.1.4
  • Database: mysql 8.0.22
  • Operating system: debian 10

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions