node.js - Dokku - 设置后添加域

标签 node.js dns dokku

我在我的 Digital Ocean droplet 上安装了 Dokku,但在设置我的 dns 记录之前就安装了,所以 Dokku 安装在 IP 上。现在我更改了我的 dns 记录,因此可以通过 site.com 访问站点。我可以通过 site.com:port 访问我之前创建的 Dokku 容器,如何更改 Dokku 设置以像这样访问我的应用程序 - appname.site.com

最佳答案

根据 https://github.com/progrium/dokku :

Set up a domain and a wildcard domain pointing to that host. Make sure /home/dokku/VHOST is set to this domain. By default it's set to whatever hostname the host has. This file is only created if the hostname can be resolved by dig (dig +short $(hostname -f)). Otherwise you have to create the file manually and set it to your preferred domain. If this file still is not present when you push your app, dokku will publish the app with a port number (i.e. http://example.com:49154 - note the missing subdomain).

要解决此问题,您首先需要更新/home/dokku/VHOST 文件,添加域名 - 这将修复任何新生成的部署,但需要从/home/中删除现有应用dokku 目录按名称(/home/dokku/foo、/home/dokku/bar 等)并重新部署以使此更改生效,因为每个 Dokku 应用程序在这些/home/dokku/路径中都有一个单独的 nginx.conf 和这些都需要重写。

关于node.js - Dokku - 设置后添加域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21785901/

相关文章:

node.js - co node.js 库的用途是什么?

azure - 如何在 Microsoft Azure 上执行第三方域设置?

node.js - Digital Ocean Dokku 无法选择构建包

git - 如何获取 dokku 应用程序的 git 远程 URL

ssl - 将多个 SSL 证书路由到一个应用程序中

node.js - 如何从mongodb中的对象数组中获取特定的数组元素

python - NodeJS 和 Python 哈希的区别

c++ - 无法访问我继承的类属性

c# - 客户端如何与具有多个适配器的计算机上的 Windows 服务通信?

node.js - 在 package.json 中配置本地 typescript 编译器