0

我试图让从“文件上传”中的项目复制的链接具有正确的域。目前他们使用' http://localhost:1337 '这是不正确的,因为 Strapi 在 Nginx 后面运行。有没有办法指定面向外部的主机是什么?

4

1 回答 1

1

在文件的“代理”块中添加面向外部的域信息./config/environments/**/server.json

{
  "host": "localhost",
  "port": 1337,
  "proxy": {
    "enabled": true,
    "ssl": true,
    "host": "example.com",
    "port": 8443
  },
  "autoReload": {
    "enabled": true
  },
  "cron": {
    "enabled": true
  }
}

https://strapi.io/documentation/3.xx/configurations/configurations.html#server

感谢Strapi 松弛频道上的 Carlos为我指明了正确的方向!

于 2018-10-10T18:49:10.410 回答